microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.5k stars 28.65k forks source link

VScode debugger on Windows cann't step in external source code #226602

Closed yangwang201911 closed 2 weeks ago

yangwang201911 commented 3 weeks ago

Does this issue occur when all extensions are disabled?: Yes/No

  1. create a main.cpp and configure with CMake to link external DLL with debug verion
  2. build main.cpp with debug version
  3. create launch.json and enable debug section with blow setting
    {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/my.exe",
            "args": [ ],
            "cwd": "${fileDirname}",
            "symbolSearchPath": "C:/Path/to/external/*.pdb/"
    }
  4. create breakpoint in main.cpp
  5. create breakpoint in the source code from external DLL with debug version
  6. start debug with "(Windows) Launch"
  7. successfully stop at the breakpoint of main.cpp, while failed to step in the source code of external DLL, and the location of the external breakpoint has changed to the location of VScode installation location of the system. expected stop point: C:\path\to\my\external\souce\code\cpp\file actual stop point: C:\Users\myuser\AppData\Local\Programs\Microsoft VS Code\my\external\souce\code\cpp\file Not sure if it is a bug or issue.
vs-code-engineering[bot] commented 3 weeks ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

roblourens commented 2 weeks ago

Please file this on the repo for the debug extension