-
Notifications
You must be signed in to change notification settings - Fork 41
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
Unable to attach to remote gdbserver #261
Comments
@thegecko do you think you can help @sherrellbc on this? |
@jonahgraham I asked for this issue to be raised here for visibility :) The only place I can see a reference to https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/blob/main/src/GDBBackend.ts#L242 I assume this is because it expects a program to be set here: https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/blob/main/src/GDBTargetDebugSession.ts#L278 @jonahgraham Is @sherrellbc can you try a config including a |
If there are use cases that program isn't needed I would be happy to review a PR that addressed that. It also sounds like we could do with a PR that gives a better error message on |
Within VSCode, my
and the adapter config is:
With a websockify proxy listening on 50001 and forwarding to 50000. With the addition of "To open a remote debug connection, you need to specify what serial device is attached to the remote system" |
Actually, after updating the config string to use
|
Please check your The binary also needs to be built with debug symbols of course |
The test binary is just a single file, and so on the remote system I have built it in
|
Turns out the pathMapping is somewhat strict. The extra space at the end of the local path side was causing the trouble. The following works:
thanks @thegecko. Also, @jonahgraham its not inconceivable that someone might be interested in debugging a remote target for which you do not have the program for. Or maybe you have the program but it doesnt have debug symbols, or you have sources but can't rebuild it for whatever reason. It is certainly less common, but in general gdb allows you to connect to a remote gdbserver instance and debug whatever it is attached to. Having debug symbols and source-level debug info is helpful, but not required. |
There is no strict need to have a program passed to GDB when attaching (remote or local). Either the program can be downloaded from the remote or otherwise read by GDB, or if not possible then GDB can do symbol-free debugging. Previously in eclipse-cdt-cloud#228 some work was done to better error when program was not specified. This change loosens the restrictions slightly. If the program is not specified, it is still a warning in VSCode because of [package.json](https://github.com/eclipse-cdt-cloud/cdt-gdb-vscode/blob/22a9f1048f9030689ed1f5f2b3e5d5e48df9047d/package.json#L205-L207) See this comment for how it is presented to a user: eclipse-cdt-cloud#261 (comment) Part of eclipse-cdt-cloud#261
I think the correct fix would be to leave the warning and handle the case. I have submitted #262 to address this case. |
There is no strict need to have a program passed to GDB when attaching (remote or local). Either the program can be downloaded from the remote or otherwise read by GDB, or if not possible then GDB can do symbol-free debugging. Previously in eclipse-cdt-cloud#228 some work was done to better error when program was not specified. This change loosens the restrictions slightly. If the program is not specified, it is still a warning in VSCode because of [package.json](https://github.com/eclipse-cdt-cloud/cdt-gdb-vscode/blob/22a9f1048f9030689ed1f5f2b3e5d5e48df9047d/package.json#L205-L207) See this comment for how it is presented to a user: eclipse-cdt-cloud#261 (comment) Part of eclipse-cdt-cloud#261
When attempting to provide a config that would instruct the adapter to attach to a remote GDB server it seems to fail. I tried the following:
As well as
With
config.json
having contents of:but again, no dice. I am attempting to use the plugin with Arm's Embedded Debugger for VSCode. When I run with the above configuration I am met with an error dialog in VSCode that simply states "arg is not iterable". From the cdt-gdb-adapter instance I see the following:
On my test gdbserver instance I do not see any client connections coming in. It is somewhat unclear if the issue is in this plugin or within Arm's VSCode plugin. However, there are no examples in this repo for how to use the
attach
request so my formation of the config is somewhat contrived based on my interpretation of the sources. Other formats I tried:The text was updated successfully, but these errors were encountered: