简体   繁体   English

GDB继续执行命令自动化

[英]GDB continue command automate

how to automate gdb execution with "continue command" for multiple signal events?.I have multiple signal exceptions occurring in the code and i have written signal handlers for all the signal exceptions. 我如何在代码中发生多个信号异常,并且为所有信号异常编写了信号处理程序。 when i run the program using gdb i need to each time manually enter "continue" whenever it gets signal event.after I enter continue it continues and catches next signal event and so on , till the end of the program. 当我使用gdb运行程序时,每次需要信号事件时,我都需要手动输入“继续”。输入继续后,它将继续并捕获下一个信号事件,依此类推,直到程序结束。 i wanted to automate this program execution in gdbinit and get all the data required for debugging for all the signal events. 我想在gdbinit中自动执行此程序,并获取调试所有信号事件所需的所有数据。 if there is any method to do this.Please suggest. 如果有任何方法可以这样做,请提出建议。

Thanks 谢谢

To continue through signals, use the following command in your .gdbinit file for EACH signal of interest: continue通过信号,请在.gdbinit文件中对感兴趣的每个EACH信号使用以下命令:

handle SIGNAL_OF_INTEREST nostop

To print a message when a signal occurs, use the following command: 要在发生信号时打印消息,请使用以下命令:

handle SIGNAL_OF_INTEREST print

For more information, see the GDB manual . 有关更多信息,请参见GDB手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM