how to specify custom gdb path to Adapter
Opened this issue · 9 comments
Hi,
I use cdt-gdb-vscode in eclipse theia application in linux. it is ok when I debug c++ code by default gdb. debug config as follows
{
"name": "c++ test",
"types": "gdb",
"request": "launch",
"program": "my c++ a.out",
"cwd": "${workspaceFolder}"
}
now I want to use my custom gdb to debug some specific c++ code. I set miDebuggerPath in configuration, but it seems that debugger still use default gdb, not my custom gdb. I am not sure whether miDebuggerPath is the right param. config as follow
{
"name": "custom gdb c++ test",
"types": "gdb",
"request": "launch",
"program": "my c++ a.out",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "path/to/my/custom gdb"
}
The right option is "gdb". Try the autocomplete in the launch.json editor to explore the options and feel free to ask follow ups.
That's weird the error says ENOENT which means it couldn't find the path. I'm surprised it displayed an error like that and still started a different gdb. Is the path passed as "gdb" work in the terminal? I wonder if you are experiencing a bug with encoding. Does it work if you put sparc gdb in /tmp?
That's weird the error says ENOENT which means it couldn't find the path. I'm surprised it displayed an error like that and still started a different gdb. Is the path passed as "gdb" work in the terminal? I wonder if you are experiencing a bug with encoding. Does it work if you put sparc gdb in /tmp?
hi
before using cdt-gdt-vscode, we use ms-vscode.cpptools as the adapter for debug gdb, in cpptools the path works. We will try to test it in /tmp next Monday.
I look forward to your analysis. Your use case should work and if we find an issue in the adapter I'll be pleased to fix or help fix it.
The error message certainly matches up with the adapter not being able to find sparc-gdb
- however I can't see why sparc-gdb isn't working.
I will point out that while you copied sparc-gdb to your /tmp, you didn't screenshot an updated launch.json that pointed at that gdb.
In addition I see this in your screenshots.
In this screenshot where you show sparc-gdb working:
the directory that contains sparc-gdb is different that what you entered in the "gdb" field of the launch.json:
Can you confirm that the paths are all correct?
For remote connections use "type"
--> gdbtarget
and fill out the target
section which has all the settings you expect, like host, port, server. If you use type = gdbtarget and request
= launch, then the adapter will automatically start the gdbserver you specify in server
- if you are launching the gdbserver manually (perhaps on another machine via ssh), you will probably want to use type = gdbtarget and request
= attach
BTW Are you an end user or an extender?