无法在.gdbinit中设置挂起的断点

时间:2012-08-22 17:23:45

标签: debugging gdb gdbinit

GDB-6.8

如果没有加载程序或库,手动设置挂起断点的工作很奇怪,但不能通过.gdbinit。可能有什么不对?

[手动方式]

(gdb) break foo.cc:111
No source file named foo.cc.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (foo.cc) pending.
(gdb) info break
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <PENDING>          foo.cc
(gdb) run myprogram

[gdbinit way] 在.gdbinit

中添加这两行
   set breakpoint pending on
   break foo.cc:111

Gdb在启动时显示以下错误。

> gdb myprogram
(enter gdb shell)
/home/<username>/.gdbinit:2: Error in sourced command file:
No symbol table is loaded.  Use the "file" command.

1 个答案:

答案 0 :(得分:3)

这是一个在2008年修复的错误,尝试升级你的gdb或使用/移植修复问题的以下补丁。

pending breakpoints without any symbols loaded yet

相关问题