microsoft / microsoft/vscode-cpptools
GDB Showing Dead Threads?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Ubuntu 20.04.6 LTS
- VS Code: 1.98.2
- C/C++ extension: 1.23.6
- OS and version of remote machine (if applicable): Ubuntu 20.04.6 LTS within Docker Container
- GDB / LLDB version: GDB 9.2
Bug Summary and Steps to Reproduce
Bug Summary:
I am trying to get debugging with GDB going but am having issues. Everything launches fine and otherwise works. Breakpoints stop the thread (program hangs) but VSCode does not update to show the program is stopped, does not list variables, etc. Basically acts as if it didn't see the breakpoint get hit.
While trying to figure this out, I noticed that the one thing it does show, the threads, is incorrect. After breaking the debugger and using the debugger console, I see this:
-exec info inferiors
Num Description Executable
- 1 process 121733 /var/pyEnv/bin/python
One process, as expected. However in my side bar:
This list goes down. There are maybe 50 or 60. VSCode thinks these are running threads but they are not. When running they all say running, when stopped they all say stopped. These threads do not exist. Perhaps this is confusing VSCode as to which "thread" it should be listening to?
When I do gdb manually on the command line, it works fine. I can set a breakpoint and have it stop there, view variables, etc. Just seems like VSCode is getting its wires crossed.
Any advice or workarounds?
Steps to reproduce:
- In this environment: debug a python "script" (I am trying to debug C code called by python)
- With this config: Launch GDB with python
- Do: Launch debugger
- See error: VSCode doesn't really let me debug. Seems to think there are a lot of threads that don't exist
Debugger Configurations
{
"name": "Debug Extension",
"type": "cppdbg",
"request": "launch",
"program": "/var/pyEnv/bin/python",
"args": ["someScript.py", "-a", "-b"],
"MIMode": "gdb",
"cwd": "${workspaceFolder}",
"miDebuggerPath": "/usr/bin/gdb"
}
Debugger Logs
I am trying to get debug logs but there is so much text that it seems to hang VSCode
Other Extensions
No response
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the supplied cppdbg launch configuration, Python script, Ubuntu Docker environment, and GDB 9.2. Compare the debugger console's -exec info inferiors output with the VS Code thread list, and use the available debugger logs to determine why breakpoint stops do not update variables or execution state. Done means the thread list reflects the actual process and breakpoint stops behave as they do in command-line GDB.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100