简体   繁体   English

用于用户输入的Linux C ++ gdb命令

[英]Linux C++ gdb command for user input

I am coding in C++ in Linux. 我在Linux中用C ++编写代码。 I have handled the ctrl C signal so that I could clean up all the resources upon exit. 我已经处理了ctrl C信号,以便可以在退出时清理所有资源。 However, I have the problem when I run gdb. 但是,我在运行gdb时遇到问题。 Ctrl C is also the stopping of the gdb command. Ctrl C也是gdb命令的停止。 Hence, how do I send the ctrl C to my programme so that I could test my written resource clean up code? 因此,如何将ctrl C发送到程序,以便可以测试编写的资源清理代码?

Thanks. 谢谢。

在gdb的命令提示符下:

signal SIGINT

您可以告诉GDB将信号传递给您的程序而不会停止:

(gdb) handle SIGINT pass nostop

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

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