c++ gdb:如何使用–command标志在未来共享库上设置断点

我试图使用–command标志自动化gdb会话。我试图在共享库(Unix等效的DLL)中的函数上设置断点。我的cmds.gdb看起来像这样:

set args /home/shlomi/conf/bugs/kde/font-break.txt
b IA__FcFontMatch
r

但是,我得到以下:

shlomi:~/progs/bugs-external/kde/font-breaking$ gdb --command=cmds.gdb...
GNU gdb 6.8-2mdv2009.0 (Mandriva Linux release 2009.0)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...
(no debugging symbols found)
Function "IA__FcFontMatch" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]

所以它不会设置断点。我如何让它默认回答“y”在待定的未来共享库负载设置断点?

我记得我能做某事,但不记得什么。

最佳答案
回答自己,我想给出答案,有人给了我IRC:

(gdb) apropos pending
actions -- Specify the actions to be taken at a tracepoint
set breakpoint -- Breakpoint specific settings
set breakpoint pending -- Set debugger's behavior regarding pending breakpoints
show breakpoint -- Breakpoint specific settings
show breakpoint pending -- Show debugger's behavior regarding pending breakpoints

所以设置断点挂起是骗局;它在cmds.gdb中使用,例如。

set breakpoint pending on
break <source file name>:<line number>

转载注明原文:c++ gdb:如何使用–command标志在未来共享库上设置断点 - 代码日志