GDB:如何设置未来的共享库的断点与--c​​ommand标志 [英] gdb: how to set breakpoints on future shared libraries with a --command flag

查看:260
本文介绍了GDB:如何设置未来的共享库的断点与--c​​ommand标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用自动化的--command国旗的GDB会话。我想设置一个函数断点在共享库(Unix的相当于一个DLL)。我cmds.gdb看起来是这样的:

I'm trying to automate a gdb session using the --command flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL) . My cmds.gdb looks like this:

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

不过,我得到以下几点:

However, I'm getting the following:


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设置未决未来断点共享库加载?

So it doesn't set the breakpoint after all. How can I make it default to answer "y" to set breakpoints on pending future shared library load?

我记得我能做些什么,但不记得是什么。

I recall that I was able to do something, but cannot recall what.

推荐答案

在回答我自己,我想给的答案,有人给了我在IRC上:

Replying to myself, I'd like to give the answer that someone gave me on 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 使用例如像

And so set breakpoint pending on does the trick; it is used in cmds.gdb like e.g.

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

这篇关于GDB:如何设置未来的共享库的断点与--c​​ommand标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆