问题
I'm using Visual Studio Code in a basic C++ project. I link a library built with gcc -g option to include the debug symbols information.
However, when I want to step into a function call from that library it doesn't get in. In Visual Studio this How to debug external class library projects in visual studio? would solve the problem but I don't know how to do it in Visual Studio Code. Probably source files for that library should be specified somewhere? But where can I specify them?
回答1:
Debug => Add Configurations...
This will open a launch.json file. It should look like this:
"version": ...,
"configurations": [
{
... bunch of stuff here
"justMyCode":false <==== add this line then save
}
]
Now you should be able to use breakpoints with external files.
来源:https://stackoverflow.com/questions/57025332/how-to-debug-external-library-code-in-visual-studio-code