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

[Feature Request] Improve Debug: Attach to Running Process #4740

Closed
andyj513 opened this issue Dec 13, 2019 · 5 comments
Closed

[Feature Request] Improve Debug: Attach to Running Process #4740

andyj513 opened this issue Dec 13, 2019 · 5 comments
Labels
debugger investigate: repro This issue's repro steps needs to be investigated/confirmed

Comments

@andyj513
Copy link

Type: Debugger

I frequently debug a (specific) running process using VS Code on Windows, remote debugging an already running C++ process on Linux. I have a few related suggestions (and/or bugs) for launch.json, and the documentation of it:

  1. In launch.json, I have "processId":"${command:pickProcess}", which works. However, I also have the "program" setting specified (which the documentation says is "required" -- see Cannot read property 'document' of null #3), but the list of running processes that are displayed is never filtered to only show that "program". So, this is my first suggestion: If a "program" is specified, filter the list to only that program (there may still be more than one). This could be done by starting the running program selection with the "program" text in the search box (related to Path must be a string. Received undefined #2). Or, it could be done without the search box by simply limiting the list to those processes which match. If the latter, perhaps skip displaying the list of just one item and/or have an option to do so.

  2. In the running program selection box, I am frequently typing the same thing (actually, different than my "program", because I am searching for a command-line parameter). It would be nice if I could specify some default text search string in launch.json (that could override "program" if you also do Code completion with C/C++ extension #1). I would still want to be able to edit the text, but this text could appear as the default/initial text in the search box.

  3. The documentation on https://code.visualstudio.com/docs/cpp/launch-json-reference says that "program" is "required". However, it does not appear to actually be required (at least in my scenario it seems to be ignored).

  4. The documentation on https://code.visualstudio.com/docs/cpp/launch-json-reference lists "externalConsole" option. However, A) The editor shows a yellow squiggly for it, and B) See Attach not working #4592 where I found out that my debugger never actually attaches when that setting is present (after selecting the process to attach to). Please update the documentation and also make the debugger still work if an invalid entry is present in launch.json (or at least report it in the notifications).

(I originally posted this at microsoft/vscode#86946, but they said to post it here).

@WardenGnaw WardenGnaw added debugger investigate: repro This issue's repro steps needs to be investigated/confirmed labels Dec 17, 2019
@pieandcakes
Copy link
Contributor

The documentation on https://code.visualstudio.com/docs/cpp/launch-json-reference says that "program" is "required". However, it does not appear to actually be required (at least in my scenario it seems to be ignored).

It is required because that is what we tell gdb to load for symbols.

@pieandcakes
Copy link
Contributor

For 1, we will need to parse the config and get the filename of program and filter here

@pieandcakes
Copy link
Contributor

pieandcakes commented Jan 17, 2020

For 4: microsoft/vscode-docs#3352. I commented about the invalid entry as i suspect VS Code is not doing the right thing.

@mattfysh
Copy link

I'd love these features too, I'm wondering if there is a way around by using custom launch commands in launch.json. Can you set processId to 0 and then on launch, run a custom script that selects the process id for you?

@github-actions
Copy link

github-actions bot commented Dec 9, 2020

This issue has been closed automatically because it has not had recent activity.

@github-actions github-actions bot closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger investigate: repro This issue's repro steps needs to be investigated/confirmed
Projects
None yet
Development

No branches or pull requests

4 participants