eclipse-cdt-cloud/cdt-gdb-adapter

Can cwd work in launch.json?

Closed this issue · 13 comments

hi,
I use cdt-gdb-adapter in vscode,config in launch.json as follow
{
"type": "gdbtarget",
"request": "attach",
"name": "gdb-TARGET",
"program": "E:\bm3823\sparc_demo\dacdemo\a.out",
"gdb": "E:\gdb\sparc-gdb.exe",
"target": {"host": "127.0.0.1","port": "9000","server": "gdbserver"}
},
my problem is that

  1. the a.out is build in another computer, in that computer the source file is in D disk.
  2. I copy a.out to my computer into E disk
  3. when I debug use above config and try to insert break point, the debugger will try to find the source file in D, not my current opened folder
    image
  4. as you can see the left main.c is in D disk, the right main.c is my current opened project file. break point do not appear in E main.c
  5. I remember there is a cmd arg in config when use cpptools, but I try to set cwd in above it not work, how to deal with this situation in cdt-gdb-adapter?

Thanks for the bug report! Where did you install the adapter from? In particular which version is it. I ask because this sounds like the bug I recently tried to fix in #306

Hi,
I use eclipse-cdt.cdt-gdb-vscode-0.0.103.vsix, I download from https://open-vsx.org/extension/eclipse-cdt/cdt-gdb-vscode. #306 is mine

v0.0.103 doesn't include the fix. I'll publish a new version soon if possible.

#306 is mine

What does this ^^^ mean?

v0.0.103 doesn't include the fix. I'll publish a new version soon if possible.

#306 is mine

What does this ^^^ mean?

haha, sorry for mistake, some copy paste error in replay

Cross reference to what is holding up getting the fix in #306 on to open vsx: eclipse-cdt-cloud/cdt-gdb-vscode#96 (comment)

v0.0.104 is scheduled to be auto-published to openvsx overnight tonight and that should fix your issue. Please let me know if you still have issues once you update.

hi,
when I update to v0.0.104, I click debug and no response.
image
nothing in debugconsole, and I remove cwd option and debug still no reponse in v0.0.104.
image
when I use v0.0.103, I can debug it.
image
did I missing some setting in v0.0.104?

did I missing some setting in v0.0.104?

No, you didn't miss anything. There is a critical error in v0.0.104, see eclipse-cdt-cloud/cdt-gdb-vscode#104

PS The default for cwd is the dirname of the program, so you shouldn't need to specify the cwd explicitly:

// defaults to dirname of the program, if present or the cwd of the process of the adapter
cwd?: string;

hi,
it is a pitty, v0.0.105 still no response when debug, I check v0.0.103's package json,
image
v0.0.103 use follow line,but works,
"program": "./node_modules/cdt-gdb-adapter/dist/debugAdapter.js"
may be some other problem cause debug no response in v0.0.105

I have tried 0.0.105 in both VSCode and Theia (cdt cloud blueprint) on both Windows and Linux and I cannot reproduce the problem you are seeing. Can you provide additional details?

hi,
I upload my demo project, you can open it with vscode and click debug you will get follow info when use 0.0.103
image
but if you use 0.0.105,no response, nothing happen
because my gdb size is bigger than 25M, I can not upload it to there.if you can get sparc-gdb.exe ENOENT when using 0.0.105, you can give a email , I will send my sparc-gdb to you.

dacdemo.zip

@wss29 we're tracking this problem here: eclipse-cdt-cloud/cdt-gdb-vscode#111