-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add support for using extended-remote with launch configurations #195
base: master
Are you sure you want to change the base?
Conversation
This is my first Node.js code ever, so please bear with me. |
2921f7a
to
bca7a61
Compare
Changed string quoting to backticks for better readability and rebased to master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is support for extended-remote already. See https://github.com/WebFreak001/code-debug/blob/master/package.json#L428 and #91
So I would remove the remote & executable arguments from LaunchRequestArgument again and instead write an example configuration using the existing syntax.
For remote debugging copying the executable and changing it is a great change though. It would be great if this was done in the attach function in mi2.ts line 243. Best to add a "copyExecutable" boolean value for this so it doesn't change behavior of previous configurations and possibly overrides some files on the remote system.
Please take a look at 318ece4. Why do you want to have this in attach instead of launch? Logically (and practically), attach is for attaching to an existing process, and launch is for starting a new process and debugging that. What I do here is copying the executable to the remote, launching it and debugging it from there. I believe doing this as an AttachRequest will be confusing, and also complicate the code, as attach will then have to do the same as launch already does. |
I see, launch does make sense for actually starting the application, but it feels like it could be confusing adding an additional "executable" field to the launch settings. Connecting to a remote and executing the launch commands there also feels a little bit like it's not actually launching. Using attach will also show a stop button with some kind of cable icon in the stop button which I think fits extended remote more. Displaying it with the attach UI also implies that it is not running locally or that the extension is not in direct control over the executable (as the remote is), which would be a little bit more clear I think. Adding the file copy commands, which are a great addition for remote debugging, to the attach code instead would make the code changes extremely minimal. See the |
While I do agree with you that the executable argument added to Looking forward, it might be best to fix this now, renaming the I don't share your feeling that a remote launch does not feel As for the code structure, handling extended-remote launch in What should we do? |
I too think a new executable argument with backwards compatibility from target (and deprecation message) would be very nice for the user indeed. With a new clear key for this I agree this change makes sense and would make a good addition. However I think if we add the copy files commands, they should also be added to attach for consistency because that does seem like a very useful command for debugging. For a plan I would now suggest:
Also please add the new configuration attributes to the JSON schema of the GDB section and change the keys in LLDB and Mago-MI if you rename executable. See https://json-schema.org/ |
Should we leave the attach arguments as they are now? The target and remote arguments there are also kind of tricky/confusing. |
hm for attach I don't think "target" is such a bad name |
As the target argument for launch configurations is an executable, let's name it as such to avoid confusion. The target argument is deprecated but kept for backwards compatibility.
This extends gdb launch configurations to support extended-remote. It can be used for remote debugging where code is compiled on host, and transferred and debugged on target using a remote gdbserver (or something else speaking GDB/MI). Note, this is not touching the code added in commit 318ece4 ("Added special commands for extended-remote fix WebFreak001#91"), as that is only related to gdb attach configuration.
bca7a61
to
ded131d
Compare
Ok, I have updated PR with the changes regarding launch target/executable argument. I will not be adding generic copy commands in this PR. I believe it is better handled in another PR (and I am not sure how the configuration parameter for that should look like). |
Is there any progress in this PR? Can it be merged? Would be very helpful to have this feature. |
Removed previous comment. |
What is the status of this PR ? I am facing a problem which I think might be fixed by this PR.
Unfortunately attempts at making this work fail with errors similar to : VSCode shows me a dialog box with the following message:
There doesn't appear to be a way to use "extended-remote" |
Thank you for the reply.
I *think* I am doing what is recommended
On the remote console I see this:
***@***.***:~/WORK$ gdbserver --multi :1234
Listening on port 1234
Remote debugging from host fd00::71e1:c800:2878:e368, port 37052
Remote side has terminated connection. GDBserver will reopen the
connection.
Listening on port 1234
WIthin VSCode, I see this:
[image: image.png]
…On Sat, 14 Sept 2024 at 00:14, Simon Sobisch ***@***.***> wrote:
@Smit-tay <https://github.com/Smit-tay> wrote:
There doesn't appear to be a way to use "extended-remote"
please have a look at #330
<#330> which includes
samples how to do that and has the discussion about how this should be
adjusted
—
Reply to this email directly, view it on GitHub
<#195 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5P73T5X5GABQQCYEO7273ZWNPTDAVCNFSM6AAAAABI5FZUAGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJQGQ3DQNJUGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This extends gdb launch configurations to support extended-remote.
It can be used for remote debugging where code is compiled on host, and
transferred and debugged on target using a remote gdbserver (or something
else speaking GDB/MI).
Note, this is not touching the code added in commit
318ece4 ("Added special commands for extended-remote fix #91"),
as that is only related to gdb attach configuration, although the
example in package.json is confusingly put with launch, which is
opposite of the code change.
I did not fixup that change, as I am not sure exactly what to put
instead.