Page 1 of 1

Problem starting gdb on VS code

Posted: Wed Feb 19, 2020 10:17 pm
by felixcollins
Hi,
I get an error pop-up when trying to launch gdb.

It says " Failed to load MI Debugger: Error: write EPIPE"

I can run it in the terminal and connect to OCD successfully. It was working in the past so I'm wondering if an update broke it.
Anyone know what this means?
Cheers,
Felix

https://imgur.com/sMCeZrh

My launch.json:

Code: Select all

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Launch Program",
			"type": "gdb",
			"request": "launch",
			"target": "./build/${workspaceFolderBasename}.elf",
			"cwd": "${workspaceFolder}",
			"gdbpath": "xtensa-esp32-elf-gdb",
			"autorun": [
				"target remote :3333",
				"mon reset halt",
				"flushregs",
				"thb app_main",
				"c"
			],
			"preLaunchTask": "openocd",
			"postDebugTask": "killopenocd"
		}
	]
}

Re: Problem starting gdb on VS code

Posted: Thu Feb 27, 2020 4:23 am
by ESP_bignacio
Hi there !

We are currently working on debug support in our extension for VS Code. In the meantime you can try use:

Code: Select all

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "cppdbg",
            "request": "launch",
            "name": "ESP-IDF: Debug",
            "miDebuggerPath": "xtensa-esp32-elf-gdb",
            "program": "${workspaceFolder}/build/project-name.elf",
            "miDebuggerServerAddress": "localhost:3333",            
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb"
        },
    ]
}
and use .gdbinit in your project folder to set up gdb commands.

In our extension there is support to run openOCD from VS Code itself and others commands that might make development process easier.

Please give it a try in https://marketplace.visualstudio.com/it ... -extension