繁体   English   中英

使用 Visual Studio Code 调试 C++ 代码时,是否可以自动跳过标准包括

[英]When debugging C++ code using Visual Studio Code, is it possible to automatically step over standard includes

例如:在下面的代码中,注释行中的一个步骤将跳转到标准字符串 header。

有没有办法避免这种情况?

#include <string>
#include <iostream>

int main()
{
    std::string a = "Example String"; /// < Step IN here 

    std::cout << a << std::endl; 
}

打开:工具 > 选项 > 调试 > 常规 > []启用仅我的代码

看来我可以对最新版本的 gcc(7.12.1 或更高版本)执行此操作,并在 .gdbinit 文件中使用以下内容

skip -gfi /usr/include/c++/*/*/*
skip -gfi /usr/include/c++/*/*
skip -gfi /usr/include/c++/*

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM