microsoft / microsoft/vscode-cpptools

Automatically attach gdb to child processes

Open
#11,052 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Feature Request

this is perhaps a bit more complex than it sounds from the title. We submitted a feature request to the main vscode repo, and believe that is actually the correct place to address this, but they indicated this was the place to ask.

A little bit of background to explain the motivation:

We run a model-based simulation involving many (3 ~ 120) C++ parallel child processes, and a single parent "coordinator" that is responsible for launching, synchronizing, stepping, and, potentially killing/restarting these individual executables. At the beginning of simulation, this "coordinator" ingests a json that includes a description of which child processes to launch, and how to launch them.

We would like to capture the PIDs of child processes (C++) and automatically attach GDB to them, and there doesn't seem like a very good workflow for doing this. At present, we make use of separate attach launch tasks, and manually attach debuggers to a subset of child processes a few seconds after the parent launches them, using Augusto's Tasks Shell Input extension to capture child PIDs. It would be extremely helpful to both us and our users if that manual attachment could be made to be automatic.

A "vanilla" compound launch configuration doesn't work to debug the child processes, even with attach--it seems vscode wants to be able to attach to all configurations of a compound task immediately. Because the parent process (the "coordinator") has to do some work (such as ingesting the json description of the child processes) the child processes are not immediately available to attach to, so this seems not workable at present. This seems like an issue with compound tasks relying on pre-launch tasks to complete (i.e. in this case we would want a delay) before launching all their sub tasks (not sure of correct terminology here).

There might be a way of doing this out of the box in code but we have searched far and wide and have not been able to discover it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file, test, or implementation entry point is identified. Start by reviewing the linked VS Code feature request and the compound launch and attach workflow described here. Done would mean defining and implementing a supported way to attach GDB to child processes after the coordinator makes them available, with a documented workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.