Go Avoiding GDB Signal Noise.

Source: Internet
Author: User

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

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

Suppose your program handles a signal this 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 the this point, but if it happens repeatedly in various threads (as if one thread is Callin G Pthread_kill () to force each other thread in turn to dump it stack and stuff) This repeated ' C ' ing can be a bit of a PA In.

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             User defined signal 1

And if deemed to is 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

??

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.