How to debug external library code in Visual Studio Code?

安稳与你 提交于 2020-08-25 12:34:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!