microsoft / microsoft/vscode-cpptools

/ replaced with %2F in the DEBUG CONSOLE

Open
#11,617 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger help wanted
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: 14.1 (23B74)
  • VS Code: Version: 1.84.0
  • C/C++ extension: v1.17.5
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version: The command: /usr/bin/lldb-mi --version exited with code: 127
    [proc] Executing command: /Users/<M.E>/.vscode/extensions/ms-vscode.cpptools-1.17.5-darwin-arm64/debugAdapters/lldb-mi/bin/lldb-mi --version
Bug Summary and Steps to Reproduce

Bug Summary:
A big project can not hit the breakpoints on MacOS arm64; they are grayed out.

So When I comment out all the code and have a simple main function, the breakpoint is red again. I looked at the "DEBUG CONSOLE," and it seems that it shows two issues when the breakpoints are grayed out

  1. The forward slashes "/" for the paths are replaced with "%2F"
  2. The root dir of the file is "git:/" instead of just "/"
Debugger Configurations
{
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            // Resolved by CMake Tools:
            "program": "${command:cmake.launchTargetPath}",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [
                {
                    // add the directory where our target was built to the PATHs
                    // it gets resolved by CMake Tools:
                    "name": "PATH",
                    "value": "$PATH:${command:cmake.launchTargetDirectory}"
                },
            ],
            //"externalConsole": true,
            "MIMode": "lldb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "symbolLoadInfo": {
                "loadAll": true,
                "exceptionList": ""
            },
            "targetArchitecture": "arm64",
            "logging": {
                "engineLogging": "verbose",
                "exceptions": true,
                "natvisDiagnostics": "verbose",
                "trace": true,
                "traceResponse": true,
                "moduleLoad": true,
                "programOutput": true
            },
        }
Debugger Logs
<--   C (setBreakpoints-5): {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"git:/Users/<M.E>/repo/<PROJ>/<SUBPROJ>/src/<PJ>/main.cpp?%7B%22path%22%3A%22%2FUsers%2F<M.E>%2Frepo%2F<PROJ>%2F<SUBPROJ>%2Fsrc%2F<PJ>%2Fmain.cpp%22%2C%22ref%22%3A%22HEAD%22%7D"},"lines":[60,68,184],"breakpoints":[{"line":60},{"line":68},{"line":184}],"sourceModified":false},"type":"request","seq":5}



<-- C (setBreakpoints-16): {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"/Users/<M.E>/repo/<PROJ>/<SUBPROJ>/src/<PJ>/main.cpp","sources":[],"checksums":[]},"lines":[60,413,428,429,62],"breakpoints":[{"line":60},{"line":413},{"line":428},{"line":429},{"line":62}],"sourceModified":false},"type":"request","seq":16}
Other Extensions

CMake Tools v1.15.31

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the setBreakpoints requests in the debugger log and compare the encoded git:/ source path with the plain filesystem path. Trace the source-path handling used by the C/C++ extension on macOS arm64; the fix is complete when breakpoint requests preserve path separators and resolve to the actual source file.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.