Re: [linux] Always ignore restart/cancellation signals

Daniel Jacobowitz
2006-02-20T17:01:52Z

On Thu, Dec 08, 2005 at 09:24:20AM -0500, Daniel Jacobowitz wrote:
> The comment is fairly self-explanatory. I guess I've always debugged
> failing cancellation tests with gdbserver, which hardwires these values
> already...
>
> Any objections?

There were a few but they faded after discussion, so I have retested
and committed this patch.

--
Daniel Jacobowitz
CodeSourcery

2006-02-20 Daniel Jacobowitz <dan@codesourcery.com>

* linux-nat.c (lin_thread_get_thread_signals): Default to __SIGRTMIN
and __SIGRTMIN + 1.

Index: gdb-6.4/gdb/linux-nat.c
===================================================================
--- gdb-6.4.orig/gdb/linux-nat.c 2005-11-03 14:51:40.000000000 -0500
+++ gdb-6.4/gdb/linux-nat.c 2005-12-07 21:44:12.000000000 -0500
@@ -3284,12 +3284,18 @@ lin_thread_get_thread_signals (sigset_t
sigemptyset (set);

restart = get_signo ("__pthread_sig_restart");
+ cancel = get_signo ("__pthread_sig_cancel");
+
+ /* LinuxThreads normally uses the first two RT signals, but in some legacy
+ cases may use SIGUSR1/SIGUSR2. NPTL always uses RT signals, but does
+ not provide any way for the debugger to query the signal numbers -
+ fortunately they don't change! */
+
if (restart == 0)
- return;
+ restart = __SIGRTMIN;

- cancel = get_signo ("__pthread_sig_cancel");
if (cancel == 0)
- return;
+ cancel = __SIGRTMIN + 1;

sigaddset (set, restart);
sigaddset (set, cancel);