Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can cwd work in launch.json? #310

Closed
wss29 opened this issue Oct 27, 2023 · 13 comments
Closed

Can cwd work in launch.json? #310

wss29 opened this issue Oct 27, 2023 · 13 comments

Comments

@wss29
Copy link

wss29 commented Oct 27, 2023

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?
@jonahgraham
Copy link
Contributor

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

@wss29
Copy link
Author

wss29 commented Oct 27, 2023

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

@jonahgraham
Copy link
Contributor

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

#306 is mine

What does this ^^^ mean?

@wss29
Copy link
Author

wss29 commented Oct 27, 2023

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

@jonahgraham
Copy link
Contributor

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

@jonahgraham
Copy link
Contributor

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.

@wss29
Copy link
Author

wss29 commented Oct 30, 2023

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?

@jonahgraham
Copy link
Contributor

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

@jonahgraham
Copy link
Contributor

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;

@wss29
Copy link
Author

wss29 commented Oct 31, 2023

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

@jonahgraham
Copy link
Contributor

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?

@wss29
Copy link
Author

wss29 commented Nov 1, 2023

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

@jonahgraham
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants