GDB:打印可识别的文件

时间:2012-03-21 16:44:05

标签: c gdb

如何让GDB打印它识别的所有源文件?我试过设置一个断点:

break test.c:35

但是GDB抱怨道:

No source file name test.c

但是,我知道GDB 识别此文件,因为它识别其中定义的函数。

1 个答案:

答案 0 :(得分:1)

您可以通过info sources命令执行此操作。

(gdb) info sources 
Source files for which symbols have been read in:



Source files for which symbols will be read in on demand:

/root/test.cpp
(gdb) 

在您的情况下,应列出test.c