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
- the a.out is build in another computer, in that computer the source file is in D disk.
- I copy a.out to my computer into E disk
- 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
- 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
- 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.
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:
cdt-gdb-adapter/src/GDBDebugSession.ts
Lines 47 to 48 in 1dc3d63
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
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.
@wss29 we're tracking this problem here: eclipse-cdt-cloud/cdt-gdb-vscode#111