Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug external library code in Visual Studio Code?

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?

like image 728
paduraru2009 Avatar asked Jul 14 '19 07:07

paduraru2009


1 Answers

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.

like image 195
NobodyImportant Avatar answered Sep 16 '22 14:09

NobodyImportant