GDB 断点 [英] GDB breakpoints

查看:31
本文介绍了GDB 断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个断点列表,我想在每次调试特定程序时添加这些断点.

I have a list of breakpoints which I want to add each time I debug a particular program.

有没有办法可以将所有断点信息放在一个文件中并在每个调试会话开始时使用它?换句话说,在我发出运行"命令之前,我可以向 GDB 提供一个包含断点信息的脚本文件吗?

Is there a way I can put all of the breakpoint information in a file and use it at the start of each debug session? In other words can I provide a script file with breakpoint information to GDB before I give the 'run' command?

推荐答案

来自 ma​​n gdb(1):

  -x file
           Execute GDB commands from file file.

然后您可以将断点放在一个文件中:

You could then put your breakpoints in a file:

break [file:]function
break [file:]function
...

这篇关于GDB 断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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