microsoft / microsoft/vscode-cpptools

MinGW 13.2.0 toolchain's GDB (version 11.2), when run through the C/C++ Debug Adapter, cannot force the program to break without a defined breakpoint.

Offen
#13,191 4 Kommentare 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:
    Windows 10 22H2 Build Version 19045.5371

  • VS Code:
    1.96.3

  • C/C++ extension:
    1.22.11

  • GDB / LLDB version:

GNU gdb (GDB) 11.2 (Provided with the MinGW version below.

  • MinGW build used:

https://github.com/niXman/mingw-builds-binaries/releases/tag/13.2.0-rt_v11-rev1

(This is an official build pointed to by MinGW's downloads page, under the MinGW-w64 Builds heading https://www.mingw-w64.org/downloads/)

Bug Summary and Steps to Reproduce

Bug Summary:

The bugger starts successfully, but then the program refuses to break unless a breakpoint is set prior to execution. The "pause" button does not work.

Why are we using MinGW on Windows? We're doing some work with an analysis tool that only supports GCC. Switching to MSVC is not a viable workaround.

Steps to reproduce:

  1. Configure a C++ "cppdbg" debug target with the MIMode and MIDebuggerPath pointing to MinGW's GDB.
  2. Run your debug target
  3. Attempt to force a break with the "pause" button
  4. The program will refuse to pause.
  5. Stop the program. Set a breakpoint.
  6. The program successfully breaks at the breakpoint.
Debugger Configurations
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Big Endian Network Converter (Windows)",
            "type": "cppdbg",
            "request": "launch",
            "program": "${command:cmake.buildDirectory}\\tools\\bigendian_network_converter\\${command:cmake.buildType}\\bigendian_network_converter-windows-x86_64-${command:cmake.buildType}.exe",
            "args": [
                "-tftpip",
                "127.0.0.1",
                "-cfg",
                "ipport_common.cfg",
                "ipport.cfg",
                "bigendian_network_converter.cfg",
                "desktop.ocfg",
                "desktop_common.ocfg"
            ],
            "stopAtEntry": false,
            "cwd": "${command:cmake.buildDirectory}\\tools\\bigendian_network_converter\\${command:cmake.buildType}\\",
            "MIMode": "gdb",
            "miDebuggerPath": "${workspaceFolder}/bin/shell/mingw64/bin/gdb.exe",
            "environment": [
                {
                    // add the directory where our target was built to the PATHs
                    // it gets resolved by CMake Tools:
                    "name": "PATH",
                    "value": "${env:PATH}:${command:cmake.buildDirectory}\\tools\\bigendian_network_converter\\${command:cmake.buildType}\\"
                }
            ],
            "logging": { "engineLogging": true, "trace": true, "traceResponse": true }
        },
    ]
}
Debugger Logs
[debug_adapter_logs.txt](https://github.com/user-attachments/files/18540942/debug_adapter_logs.txt)
Other Extensions
  1. njpwerner.autodocstring
  2. Damien.autoit
  3. ms-vscode.cpptools-extension-pack
  4. Parasoft.vscode-cpptest
  5. twxs.cmake
  6. ms-vscode.cmake-tools
Additional Information

The nature of this work is sensitive, and the amount of information that I can provide about our codebase is limited. I would be happy to build smaller examples for the purposes of debugging this, however.

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

Beginnen Sie damit, die cppdbg-Konfiguration mit dem aufgeführten MinGW-GDB-Setup zu reproduzieren, und untersuchen Sie anschließend die angehängte Datei debug_adapter_logs.txt auf die Pause-Anforderung und -Antwort. Vergleichen Sie das Verhalten mit und ohne Breakpoint; als erledigt gilt die Aufgabe, wenn die Pause-Aktion von VS Code das laufende Programm anhält, ohne dass ein vordefinierter Breakpoint erforderlich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, vscode
Bereich
developer-experience, devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

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