gdb控制/屏蔽信号
来源:互联网 发布:梦幻西游mac版快捷键 编辑:程序博客网 时间:2024/04/29 22:08
http://blog.sina.com.cn/s/blog_48ebca64010005a6.html
gdb中如何屏蔽信号
某些涉及到信号处理的程序该如何用gdb来调试呢?例如,进程需要捕捉SIGINT信号,但是在gdb中直接按“ctrl C"肯定不行,因为缺省情况下只有gdb接收到该信号,那么,该怎么办呢?
在gdb中,看一下帮助吧:
(gdb) help handle
Specify how to handle a signal.
Args are signals and actions to apply to those signals.
Symbolic signals (e.g. SIGSEGV) are recommended but numeric signals
from 1-15 are allowed for compatibility with old versions of GDB.
Numeric ranges may be specified with the form LOW-HIGH (e.g. 1-5).
The special arg "all" is recognized to mean all signals except those
used by the debugger, typically SIGTRAP and SIGINT.
Recognized actions include "stop", "nostop", "print", "noprint",
"pass", "nopass", "ignore", or "noignore".
Stop means reenter debugger if this signal happens (implies print).
Print means print a message if this signal happens.
Pass means let program see this signal; otherwise program doesn't know.
Ignore is a synonym for nopass and noignore is a synonym for pass.
Pass and Stop may be combined.
Specify how to handle a signal.
Args are signals and actions to apply to those signals.
Symbolic signals (e.g. SIGSEGV) are recommended but numeric signals
from 1-15 are allowed for compatibility with old versions of GDB.
Numeric ranges may be specified with the form LOW-HIGH (e.g. 1-5).
The special arg "all" is recognized to mean all signals except those
used by the debugger, typically SIGTRAP and SIGINT.
Recognized actions include "stop", "nostop", "print", "noprint",
"pass", "nopass", "ignore", or "noignore".
Stop means reenter debugger if this signal happens (implies print).
Print means print a message if this signal happens.
Pass means let program see this signal; otherwise program doesn't know.
Ignore is a synonym for nopass and noignore is a synonym for pass.
Pass and Stop may be combined.
缺省情况下,是stop/nopass/print的,如前所述,如果我们需要在被调试进程中捕捉SIGINT信号,那么这样做:
handle SIGINT pass
handle SIGINT nostop
- gdb控制/屏蔽信号
- 屏蔽信号
- 信号屏蔽
- Linux高级编程 第六章 进程控制 信号 定时器 信号操作 信号屏蔽
- 信号集与屏蔽信号
- 信号屏蔽的小点
- 信号屏蔽字
- 信号屏蔽字
- linux 信号屏蔽
- 信号屏蔽函数
- linux信号屏蔽字
- 信号屏蔽字
- Linux--信号屏蔽
- 信号屏蔽pending
- 信号屏蔽pending
- 信号屏蔽(pending)
- 信号屏蔽pending
- 如何实现信号屏蔽
- 计算机系统漫游
- MyEclipse快捷键大全
- android draw9patch的制作和使用总结
- Python IDLE快捷键,以及如何自定义快捷键
- Android各activity,service进程的生命周期
- gdb控制/屏蔽信号
- 根据面试注意事项,平时注意提高自己
- 第十二周项目5-银行系统
- error和exception的区别,RuntimeException和非RuntimeException的区别
- C++类对象创建过程揭密
- Android颜色RGB值
- Ubuntu 12.04中的eclipse 安装1.7版svn插件问题
- 银联接口C#
- Hdu 2089 数位dp