microsoft / microsoft/vscode-cpptools

[bug] `cppdbg` hangs up and quits out by itself

Offen
#9,089 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

debugger more info needed
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Bug type: Debugger

Describe the bug

  • OS and Version: Windows 11 home 21H1 22000.556
  • VS Code Version:
    Version: 1.65.2 (system setup)
    Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
    Date: 2022-03-10T14:33:55.248Z
    Electron: 13.5.2
    Chromium: 91.0.4472.164
    Node.js: 14.16.0
    V8: 9.1.269.39-electron.0
    OS: Windows_NT x64 10.0.22000
    
  • C/C++ Extension Version: v1.9.7
  • Other extensions you installed (and if the issue persists after disabling them):
    Name: C/C++ Extension Pack
    ID: ms-vscode.cpptools-extension-pack
    About: Popular extensions for C++ development in Visual Studio Code.
    Version: 1.1.0
    Distributor: Microsoft
    VS Marketplace link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack
    
    Simplified Chinese Extension
    Golang
    Rust-Analyzer
    
  • A clear and concise description of what the bug is.
    Start debugging, command-line showes, with input blocked:
  & 'c:\Users\<user>\.vscode\extensions\ms-vscode.cpptools-1.9.7\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-30v2n0bd.4ez' '--stdout=Microsoft-MIEngine-Out-sulr42l3.5u3' '--stderr=Microsoft-MIEngine-Error-42mhsbwh.w3f' '--pid=Microsoft-MIEngine-Pid-htnzwcvq.dhz' '--dbgExe=C:\msys64\usr\bin\gdb.exe' '--interpreter=mi'

By this time, inputting in the terminal is impossible, and no break points from the source file could be hitten, even if you compiled a single file with -g option.
Wait for a little more time, the debugger will quit out by itself, though the program requires input from stdin.
Detailed information is in the video below:

https://user-images.githubusercontent.com/44747719/160173782-c21d5dc7-b305-4809-8a9e-3edf9dab28bb.mp4

To Reproduce
Please include a code sample and launch.json configuration.

// launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "C++ quick run",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
      "args": [],
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\msys64\\usr\\bin\\gdb.exe",
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      // "console": "integratedTerminal",
      "preLaunchTask": "C/C++: g++.exe produce active file",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "logging": {
        "engineLogging": true,
        "trace": true,
        "traceResponse": true
      }
    }
  ]
}

// task involved
{
      "type": "cppbuild",
      "label": "C/C++: g++.exe produce active file",
      "command": "C:\\msys64\\usr\\bin\\g++.exe",
      "args": [
        "-g",
        "--std=c++17",
        "-fdiagnostics-color=always",
        "-o",
        "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "${file}"
      ],
      "options": {
        "cwd": "${fileDirname}"
      },
      "problemMatcher": ["$gcc"],
      "group": "build",
      "detail": "produced by debugger" // cpptools
    },

Steps to reproduce the behaviour:

  1. Go to the single file you want to run
  2. Click on debug "C++ quick run".
  3. Wait for it.
  4. See the error.

Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json

Before raising this issue, I've found that there are issues about Windows10's Beta UTF-8 feature, but I've turned it on and off, and nothing had happened, the bug now still exists.
Here is the log file, it's very huge and some part of it is in Chinese.

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

Beginne damit, den Fall unter Windows 11 mit der bereitgestellten launch.json und der C/C++-Buildaufgabe zu reproduzieren, und untersuche anschließend die verknüpfte Protokolldatei und den Aufruf von WindowsDebugLauncher.exe. Vergleiche das Verhalten von stdin, die Behandlung von Haltepunkten und das Beenden des Debuggers mit den beschriebenen Schritten; fertig ist die Aufgabe, wenn die Eingabe weiterhin verwendbar ist, Haltepunkte erreicht werden können und der Debugger nicht unerwartet beendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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