GDB断点 [英] GDB breakpoints

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

问题描述

每次我调试特定程序时,我都要添加一个断点列表。
是否有办法将所有这些断点信息放在一个文件中并在每个调试会话开始时使用它?换句话说,在我给出'run'命令之前,我可以为脚本文件提供带有断点信息的脚本文件

在此先感谢,
Sachin

解决方案

man gdb(1)

  -x文件
从文件文件执行GDB命令。

然后,您可以将断点放入文件中:

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


I have a list of breakpoints which I want to add each time I debug a particular program. Is there a way I can put all these breakpoint information in a file and use it at the starting of each debug session? In other words can I provide a script file with breakpoint information to GDB before I give the 'run' command.

Thanks in Advance, Sachin

解决方案

From man 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天全站免登陆