0

当我在 cgdb 中踏入这一行时

if (cfgFile.good()) //Settings:cpp:31
 std::cout << "File load succeeded" << std::endl; //Settings:cpp:32


我收到这个错误

(gdb) run 
The program being debugged has been started already.
Start it from the beginning? (y or n) y
The program being debugged has been started already.
Starting program: /home/sk33z0/Documents/PROGRAMMING/PROJECTS/C++/WORLD_LEGENDS/WORLDLEGENDS 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Breakpoint 1, Settings::load (this=0xbfffef24) at /home/sk33z0/Documents/PROGRAMMING/PROJECTS/C++/WORLD_LEGENDS/src/Settings.cpp:31
(gdb) step
std::basic_ios<char, std::char_traits<char> >::good (this=0xbfffefb8) at /build/gcc/src/gcc-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h:181
181     /build/gcc/src/gcc-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h: No such file or directory.



显然,在使用 cgdb 指定它们后,它看不到我的系统头文件

dir -isystem path/to/gcc/system/headers

根据错误,它正在basic_ios.h寻找

/build/gcc/src/gcc-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h


但是该目录在我的文件系统中不存在,但我确实在这些目录中有该文件

/usr/include/c++/6.2.1/bits/basic_ios.h

/usr/lib/gcc/i686-pc-linux-gnu/5.4.0/include/c++/bits/basic_ios.h

我怎样才能让 cgdb 也单步执行系统头文件。我必须在我的 cmake 文件中做些什么吗?我确实使用调试标志构建了我的程序,所以出了什么问题?

4

0 回答 0