[轉]Avoiding GDB Signal Noise.

來源:互聯網
上載者:User

標籤:des   style   http   color   os   io   for   ar   

原文:http://peeterjoot.wordpress.com/2010/07/07/avoiding-gdb-signal-noise/

A quick note for future reference (recorded elsewhere and subsequently lost).

Suppose your program handles a signal that gdb intercepts by default, like the following example

(gdb) cContinuing.Program received signal SIGUSR1, User defined signal 1.[Switching to Thread 47133440862528 (LWP 4833)]0x00002ade149d6baa in semtimedop () from /lib64/libc.so.6(gdb) c

You can hit ‘c’ to continue at this point, but if it happens repeatedly in various threads (like when one thread is calling pthread_kill() to force each other thread in turn to dump its stack and stuff) this repeated ‘c’ing can be a bit of a pain.

For the same SIGUSR1 example above, you can query the gdb handler rules like so:

(gdb) info signal SIGUSR1Signal        Stop      Print   Pass to program DescriptionSIGUSR1       Yes       Yes     Yes             User defined signal 1

And if deemed to not be of interest, where you just want your program to continue without prompting or spamming, something like the following does the trick:

(gdb) handle SIGUSR1 noprint nostopSignal        Stop      Print   Pass to program DescriptionSIGUSR1       No        No      Yes             User defined signal 1

??

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.