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方式] 将这两行加入.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.