microsoft / microsoft/vscode-cpptools

Debug multi-process application problem

Open
#4,189 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm trying debug multi-process app. So, I do it:

  1. Start Debugging (F5)
  2. Type in Debug Console -exec attach <pid>, <pid> -- is process id of child from ps aux | grep appname
  3. However, I get error:
-exec attach 3331
Unable to perform this action because the process is running.
  1. So, I guessed that I should set debugging to pause. Pressed Pause (F6), and got following error:
-exec attach 3331
A program is being debugged already.  Kill it? (y or n) [answered Y; input not from terminal]
...
Thread 1 "kamailio" stopped.
0x00007ffff76a9912 in __libc_pause () at ../sysdeps/unix/sysv/linux/pause.c:30
ERROR: Error while trying to enter break state. Debugging will now stop. GDB exited unexpectedly.
The program '/home/marat/work_folder/kamailio-git/build/sbin/kamailio' has exited with code 42 (0x0000002a).

ERROR: GDB exited unexpectedly. Debugging will now abort.

-exec set follow-fork-mode child is not suitable I think, because application has more than 1 child processes.
And how I can fix 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

Start by reproducing the F5/F6 workflow in the Debug Console with -exec attach <pid> against an application with multiple child processes. Investigate how the VS Code C/C++ extension and GDB handle attaching while the launched program is running and entering break state. Done means multi-process debugging no longer exits GDB unexpectedly, or the supported workflow and limitation are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.