使用“rbreak filename.c:”在文件中放置断点。不起作用
我想在文件的所有函数上放置断点。我发现了这个链接: http://sourceware.org /gdb/download/onlinedocs/gdb/Set-Breaks.html#Set-Breaks
建议使用 rbreak 命令来实现此目的。当我使用“rbreak”时。 ,它按预期工作正常,并在 prog 的所有函数中放置断点。但是什么时候使用
rbreak filename.c:。
这根本不起作用,并且没有在任何地方放置断点。我什至尝试了一种在 : 周围放置空格的变体,但即使这样也不起作用。
关于如何做到这一点有什么想法吗?有可能吗? 任何帮助将不胜感激。
谢谢, 维卡斯
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
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 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.
thanks,
vikas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
rbreak filename.cpp:.*
对我来说效果很好。请注意,为了在文件中放置断点,您需要使用调试信息编译程序,例如
rbreak filename.cpp:.*
works fine for me.Note that in order to put breakpoint in a file you need to compile the program with debug info, e.g
那不应该起作用。从您链接到的文档来看:
这与 locations 不同,其中要使用
filename.c:...
。这是一个不寻常的要求。在我多年的调试过程中,我从来不需要这样做。
您必须准备一个列表,并单独设置断点。可以找到执行此操作的秘诀 这里。
That isn't supposed to work. From the document you linked to:
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.