-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support attach process on a remote target with remote/extended-remote mode #9505
Comments
Is this resolved with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.11.3 ? I'm not sure why there are 4 issues tracking the same issue. Let us know if something isn't fully resolved. |
@sean-mcmanus Thanks. I try the new option "useExtendedRemote" it works for extended-remote launch. But it still has some issue with attach function. |
@fbs2016 Can you explain your scenario in more detail? Based on your description, seem like your scenario is similar to:
This is supported though. What are the differences between this and your case? |
@xisui-MSFT Next we want to attach the running process from VSC cpptools extention on local host. How to configure it? The processId in launch.json is process id on localhost but I want to attach the processs on remote target. I try to create a configuration: From gdb client, the command is simple just like you described : gdb-> target remote/extended-remote targetIp:gdbserverPort->attach pId in target I can't find a right way to run it from VSC. |
@fbs2016 If you are using latest cpptools, you don't need to provide process ID anymore. A quick pick menu will be shown with processes on the target machine. Note that you'll need to use A sample: {
"name": "Attach with GDB",
"type": "cppdbg",
"request": "attach",
"program": "<program>",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"miDebuggerServerAddress": "<target>:<port>",
"useExtendedRemote": true
} |
@xisui-MSFT Thanks a lot.
|
As for |
@xisui-MSFT |
Try it on our target: |
Your understanding is correct. Looks like When PID is provided manually, process picker will be skipped, and step (2) will be executed directly. And since we only connect once in this case, you can use |
@xisui-MSFT Thanks a lot, I will try to add new command customized to get the process list on my target. |
Feature Request
Now cpptools support attach local process, but don't support attach a process with remote target, both "target remote" and "target extended-remote" mode.
Not Pipe transport, the target don't support ssh connection, just like launch, we can connect to target with miDebuggerServerAddress and connect to gdbserver directly.
From gdb command, attach function just one command after target connection, like "attach xxx".
Refer to "Native Debug", it supports it now.
The text was updated successfully, but these errors were encountered: