GDB多進程調試

來源:互聯網
上載者:User

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     

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.