GDB多进程调试

2013-07-06 wcdj

在平时工作中经常会用到多进程/多线程,如果程序出现bug如何定位呢?GDB是GNU/Linux环境下常用的C/C++调试工具,下面是关于GDB多进程调试的简单使用说明。


关于守护进程

http://blog.csdn.net/delphiwcdj/article/details/7364343

 

pstree –H PID

highlight this process and its ancestors


What is GDB?

GDB, the GNU Project debugger, allows you to see what isgoing on `inside' another program while it executes -- or what another programwas doing at the moment it crashed.

GDB can do four main kinds of things (plus other things insupport of these) to help you catch bugs in the act:

  • Start your program, specifying anything that might affect its behavior.
  • Make your program stop on specified conditions.
  • Examine what has happened, when your program has stopped.
  • Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.

The program being debugged can be writtenin Ada, C, C++, Objective-C, Pascal (and many other languages). Those programsmight be executing on the same machine as GDB (native) or on another machine(remote). GDB can run on most popular UNIX and Microsoft Windows variants.


GDB多进程调试

使用 GDB 调试多进程程序的子程序

http://wenku.baidu.com/view/721d830003d8ce2f00662392.html

[1] GDB: The GNU Project Debugger

http://www.gnu.org/software/gdb/

[2] Debugging Under Unix: gdb Tutorial

http://www.cs.cmu.edu/~gilpin/tutorial/

[2] 用 GDB 调试程序

http://oss.org.cn/ossdocs/gnu/linux/gdb.html

[3] GDB调试精粹及使用实例

http://fanqiang.chinaunix.net/program/other/2006-07-14/4834.shtml     



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值