Unable to set pending breakpoints in .gdbinit

杀马特。学长 韩版系。学妹 提交于 2019-12-11 09:31:07

问题


gdb-6.8

In case of the program or library is not loaded, it's weird that manually setting pending breakpoints works, but not through .gdbinit. What could be wrong?

[Manual way]

(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] Add these 2 lines in .gdbinit

   set breakpoint pending on
   break foo.cc:111

Gdb shows below error upon launching.

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

回答1:


This is a bug which was fixed in 2008, try upgrading your gdb or using/porting the following patch that fixed the problem.

pending breakpoints without any symbols loaded yet



来源:https://stackoverflow.com/questions/12078313/unable-to-set-pending-breakpoints-in-gdbinit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!