microsoft / microsoft/vscode-cpptools

GDB Showing Dead Threads?

Offen
#13,393 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug debugger help wanted
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

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:

Image

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:

  1. In this environment: debug a python "script" (I am trying to debug C code called by python)
  2. With this config: Launch GDB with python
  3. Do: Launch debugger
  4. 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduzieren Sie das Problem mit der bereitgestellten cppdbg-Launch-Konfiguration, dem Python-Skript, der Ubuntu-Docker-Umgebung und GDB 9.2. Vergleichen Sie die Ausgabe von -exec info inferiors in der Debugger-Konsole mit der Thread-Liste von VS Code und verwenden Sie die verfügbaren Debugger-Logs, um festzustellen, warum Haltepunkt-Stopps Variablen oder den Ausführungsstatus nicht aktualisieren. Die Aufgabe ist erledigt, wenn die Thread-Liste den tatsächlichen Prozess widerspiegelt und Haltepunkt-Stopps sich wie in GDB über die Befehlszeile verhalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, vscode
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.