问题描述
我想在文件的所有函数上放置断点.我遇到了这个链接:http://sourceware.org/gdb/download/onlinedocs/gdb/Set-Breaks.html#Set-Breaks
I want to put breakpoint on all functions of a file. I came across this link : http://sourceware.org/gdb/download/onlinedocs/gdb/Set-Breaks.html#Set-Breaks
建议为此使用 rbreak 命令.当我使用rbreak"时.,它可以按预期正常工作,并在 prog 的所有功能中放置断点.但是什么时候使用
It suggest the use of rbreak command for this purpose. When i use "rbreak ." , it works fine as expected and puts breakpoint in all functions of a prog. But when is use
rbreak 文件名.c:.
rbreak filename.c:.
这根本不起作用,并且没有在任何地方放置断点.我什至尝试了这种在 : 周围放置空格的变体,但即使这样也行不通.
This doesn't work at all and no breakpoint is put anywhere. I even tried a variation of this putting spaces around :, but even that doesn't work.
知道如何做到这一点吗?有可能吗?任何帮助将不胜感激.
Any idea on how this can be done ? Is it possible at all ?Any help will be greatly appreciated.
谢谢,维卡斯
推荐答案
这不应该工作.从您链接到的文档:
That isn't supposed to work. From the document you linked to:
rbreak regex
Set breakpoints on all *functions* matching the regular expression regex.
这与 locations 不同,其中 filename.c:...
旨在使用.
This is different from locations, where filename.c:...
is intended to be used.
我想在文件的所有函数上设置断点.
这是一个不寻常的请求.在我多年的调试中,我从来不需要这样做.
This is an unusual request. In my many years of debugging, I've never needed to do that.
您必须准备一个列表,并单独设置断点.可以找到这样做的秘诀 这里.
You'll have to prepare a list, and set the breakpoints individually. A recipe for doing this can be found here.
这篇关于使用“rbreak filename.c:"在文件中放置断点.不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!