How to debug a signal handler with gdb?

Hello!

I’m using QNX Neutrino.

I wrote a muti-threaded application where a thread sends a SIGUSR1 signal to
an other thread using pthread_kill().

The handler was previously installed using signal() function.

When I run the program it works, but when I run it from gdb the signal seems
to be ignored and the handler is not called.

Any idea?

Vincent.

Get gdb 5.0 from my web site, then use the handle command
to set the signal handling.

Note that this will only work if you are debugging on the local
host.

Vincent <vincent.catros_NO_SPAM_@bigfoot.com> wrote:

Hello!

I’m using QNX Neutrino.

I wrote a muti-threaded application where a thread sends a SIGUSR1 signal to
an other thread using pthread_kill().

The handler was previously installed using signal() function.

When I run the program it works, but when I run it from gdb the signal seems
to be ignored and the handler is not called.

Any idea?

Vincent.


cburgess@qnx.com

Sorry, that’s http://staff.qnx.com/~cburgess/freestuff/ntox86-gdb

Vincent <vincent.catros_NO_SPAM_@bigfoot.com> wrote:

Hello!

I’m using QNX Neutrino.

I wrote a muti-threaded application where a thread sends a SIGUSR1 signal to
an other thread using pthread_kill().

The handler was previously installed using signal() function.

When I run the program it works, but when I run it from gdb the signal seems
to be ignored and the handler is not called.

Any idea?

Vincent.


cburgess@qnx.com

Hello!

Thank you for your help.

I’ve download your gdb version from your web site and installed it (copy to
/usr/bin/ntox86-gdb-50 + ln -s /usr/bin/ntox86-gdb-50 gdb).
I did not notice any change with signal handling.
When I run my program from the shell, it works. When I run it from gdb,
signal handler is never called.

Is it a normal behaviour for gdb 5.0 or do you think I’ve made a mistake
installing gdb or configuring handles in gdb (SIGUSR1 is set
stop,print,pass)

Thank you

Vincent

Colin Burgess <cburgess@qnx.com> wrote in message
news:9etnh0$puo$2@nntp.qnx.com

Sorry, that’s > http://staff.qnx.com/~cburgess/freestuff/ntox86-gdb

Vincent <> vincent.catros_NO_SPAM_@bigfoot.com> > wrote:
Hello!

I’m using QNX Neutrino.

I wrote a muti-threaded application where a thread sends a SIGUSR1
signal to
an other thread using pthread_kill().

The handler was previously installed using signal() function.

When I run the program it works, but when I run it from gdb the signal
seems
to be ignored and the handler is not called.

Any idea?

Vincent.


\

cburgess@qnx.com

Sorry, I was sure it was working. I’ll take a look.
Vincent <vincent.catros_NO_SPAM_@bigfoot.com> wrote:

Hello!

Thank you for your help.

I’ve download your gdb version from your web site and installed it (copy to
/usr/bin/ntox86-gdb-50 + ln -s /usr/bin/ntox86-gdb-50 gdb).
I did not notice any change with signal handling.
When I run my program from the shell, it works. When I run it from gdb,
signal handler is never called.

Is it a normal behaviour for gdb 5.0 or do you think I’ve made a mistake
installing gdb or configuring handles in gdb (SIGUSR1 is set
stop,print,pass)

Thank you

Vincent

Colin Burgess <> cburgess@qnx.com> > wrote in message
news:9etnh0$puo$> 2@nntp.qnx.com> …
Sorry, that’s > http://staff.qnx.com/~cburgess/freestuff/ntox86-gdb

Vincent <> vincent.catros_NO_SPAM_@bigfoot.com> > wrote:
Hello!

I’m using QNX Neutrino.

I wrote a muti-threaded application where a thread sends a SIGUSR1
signal to
an other thread using pthread_kill().

The handler was previously installed using signal() function.

When I run the program it works, but when I run it from gdb the signal
seems
to be ignored and the handler is not called.

Any idea?

Vincent.


\

cburgess@qnx.com


cburgess@qnx.com

Colin Burgess <cburgess@qnx.com> wrote:

Sorry, I was sure it was working. I’ll take a look.

It looks like SIGUSR1 is not passed. I can catch other signals.

Vincent <> vincent.catros_NO_SPAM_@bigfoot.com> > wrote:
Hello!

Thank you for your help.

I’ve download your gdb version from your web site and installed it (copy to
/usr/bin/ntox86-gdb-50 + ln -s /usr/bin/ntox86-gdb-50 gdb).
I did not notice any change with signal handling.
When I run my program from the shell, it works. When I run it from gdb,
signal handler is never called.

Is it a normal behaviour for gdb 5.0 or do you think I’ve made a mistake
installing gdb or configuring handles in gdb (SIGUSR1 is set
stop,print,pass)

Thank you

Vincent

Colin Burgess <> cburgess@qnx.com> > wrote in message
news:9etnh0$puo$> 2@nntp.qnx.com> …
Sorry, that’s > http://staff.qnx.com/~cburgess/freestuff/ntox86-gdb

Vincent <> vincent.catros_NO_SPAM_@bigfoot.com> > wrote:
Hello!

I’m using QNX Neutrino.

I wrote a muti-threaded application where a thread sends a SIGUSR1
signal to
an other thread using pthread_kill().

The handler was previously installed using signal() function.

When I run the program it works, but when I run it from gdb the signal
seems
to be ignored and the handler is not called.

Any idea?

Vincent.


\

cburgess@qnx.com


cburgess@qnx.com


cburgess@qnx.com