Problem starting gdb on VS code

felixcollins
Posts: 123
Joined: Fri May 24, 2019 2:02 am

Problem starting gdb on VS code

Postby felixcollins » Wed Feb 19, 2020 10:17 pm

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"
		}
	]
}

ESP_bignacio
Posts: 214
Joined: Wed May 02, 2018 12:12 pm

Re: Problem starting gdb on VS code

Postby ESP_bignacio » Thu Feb 27, 2020 4:23 am

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

Who is online

Users browsing this forum: No registered users and 21 guests