如何使用命令标志在将来的共享库上设置断点 [英] How to set breakpoints on future shared libraries with a command flag

查看:104
本文介绍了如何使用命令标志在将来的共享库上设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 - 命令标志自动执行gdb会话。我试图在一个共享库的函数中设置一个断点(一个DLL的Unix等价物)。我的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>

这篇关于如何使用命令标志在将来的共享库上设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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