microsoft / microsoft/vscode-cpptools

[Mac]breakpoints not working if there are spaces in file's path

Offen
#7,916 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

debugger Feature Request
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: Mac 11.5
  • VS Code Version: 1.58.2
  • C/C++ Extension Version: 1.5.1
    In mac, use clang++ to compile and lldb to debug. If there are some spaces in the cpp file's path, the breakpoint won't work when debugging.

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:
Just use lldb debug a file whose path has some spaces.

Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

the launch.json file:

{
            "name": "(lldb) 启动",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "internalConsoleOptions": "openOnSessionStart",
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "clang++ build"
}

tasks.json:

{
            "type": "cppbuild",
            "label": "clang++ build",
            "command": "/usr/bin/clang++",
            "args": [
                "-std=c++14",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build"
},

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 mit der bereitgestellten launch.json und tasks.json und reproduziere das Problem mit clang++ und lldb anhand einer C++-Datei, deren Pfad Leerzeichen enthält. Abgeschlossen ist die Arbeit, wenn das generierte .out-Programm normal debuggt werden kann und Haltepunkte erreicht werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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