gdb:如何确认函数上设置了断点?
我在我的项目中设置了大约 50 个断点。如何确定特定函数中是否设置了断点?我不想使用它
info breakpoints
,因为它显示了所有这些。我只是想确认这个函数是否有断点。
I have set about 50 breakpoints in my project. How do I figure out if a breakpoint was set in a particular function? I don't want to use
info breakpoints
as it shows all of them. I just want to confirm if there is a breakpoint on this one function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道的唯一方法是打开日志记录,列出断点并将其关闭。然后使用 gdb 中的 cat 和 grep 按函数名称查找断点。
更改断点列表时,不要忘记删除该文件,因为这些命令会将日志附加到现有文件中,而您不希望这样做。
我知道有人可能会编写一个 gdb 脚本来自动执行此任务,但这就是主要思想。
The only approach I know for this is turning on logging, listing the breakpoints and turning it off. Then use cat and grep from within gdb to find your breakpoint by function name.
Don't forget to delete the file when you change the breakpoint list because these commands will append logs to the existing file and you don't want that.
I know that someone can probably write a gdb script to automate this task, but this is the main idea.