signal handling within gdb - Unix

This is a discussion on signal handling within gdb - Unix ; Sorry if this is a dumb question , but can someone tell me what option/ command to use with gdb on linux to prevent it catching signals sent to the program its debugging? The bug is in my programs signal ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: signal handling within gdb

  1. signal handling within gdb

    Sorry if this is a dumb question , but can someone tell me what option/
    command to use with gdb on linux to prevent it catching signals sent
    to the program its debugging? The bug is in my programs signal handler
    but obviously if gdb keeps catching the signals the handler code will
    never get run.

    Thanks for any help

    B2003

  2. Re: signal handling within gdb

    thagor2008@googlemail.com wrote:
    > Sorry if this is a dumb question , but can someone tell me what option/
    > command to use with gdb on linux to prevent it catching signals sent
    > to the program its debugging? The bug is in my programs signal handler
    > but obviously if gdb keeps catching the signals the handler code will
    > never get run.


    (gdb) handle SIGUSR1 nostop noprint

    Will stop gdb from stopping when a SIGUSR1 signal is caught and
    also will keep it from printing out a message.

    If you want to avoid entering it every time anew you start
    gdb put it into a file named '.gdbinit' in the directory
    wher eyou start gdb.
    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \__________________________ http://toerring.de

  3. Re: signal handling within gdb

    jt@toerring.de (Jens Thoms Toerring) writes:
    > thagor2008@googlemail.com wrote:
    >> Sorry if this is a dumb question , but can someone tell me what option/
    >> command to use with gdb on linux to prevent it catching signals sent
    >> to the program its debugging? The bug is in my programs signal handler
    >> but obviously if gdb keeps catching the signals the handler code will
    >> never get run.

    >
    > (gdb) handle SIGUSR1 nostop noprint
    >
    > Will stop gdb from stopping when a SIGUSR1 signal is caught and
    > also will keep it from printing out a message.


    Alternatively, after the debugger has caught the signal, a 'signal'
    command could be used to continue the program and cause an arbitrary
    signal to be sent to it.

  4. Re: signal handling within gdb

    jt@toerring.de (Jens Thoms Toerring) writes:

    > (gdb) handle SIGUSR1 nostop noprint


    You may also need 'pass', e.g. "handle SIGINT nostop noprint pass",
    at least for some signals. On Linux, SIGINT and SIGABRT require
    'pass'.

    I wonder why that is ...

    Cheers,
    --
    In order to understand recursion you must first understand recursion.
    Remove /-nsp/ for email.

+ Reply to Thread