如何在Visual Studio Code中调试外部库代码? [英] How to debug external library code in Visual Studio Code?

查看:57
本文介绍了如何在Visual Studio Code中调试外部库代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个基本的C ++项目中使用Visual Studio Code.我链接了使用gcc -g选项构建的库,以包含调试符号信息.

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.

但是,当我想进入该库的函数调用时,它不会进入.在Visual Studio中,此

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?

推荐答案

Debug =>添加配置...

Debug => Add Configurations...

这将打开launch.json文件.它应该看起来像这样:

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.

这篇关于如何在Visual Studio Code中调试外部库代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆