This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Do not use internal definition of SIGRTMIN


Define W_STOPCODE if not defined already

__SIGRTMIN is internal to glibc and other libcs e.g. musl
may not provide them

2015-10-30  Khem Raj  <raj.khem@gmail.com>

        PR 13012
        * linux-nat.c (lin_thread_get_thread_signals): Use SIGRTMIN
        * instead of
        __SIGRTMIN.
        * nat/linux-nat.h(W_STOPCODE): Define W_STOPCODE if not already
        * defined.
---
 gdb/linux-nat.c     | 4 ++--
 gdb/nat/linux-nat.h | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 841ec39..12cf91b 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -5227,10 +5227,10 @@ lin_thread_get_thread_signals (sigset_t *set)
      fortunately they don't change!  */
 
   if (restart == 0)
-    restart = __SIGRTMIN;
+    restart = SIGRTMIN;
 
   if (cancel == 0)
-    cancel = __SIGRTMIN + 1;
+    cancel = SIGRTMIN + 1;
 
   sigaddset (set, restart);
   sigaddset (set, cancel);
diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h
index 70e6274..34c9feb 100644
--- a/gdb/nat/linux-nat.h
+++ b/gdb/nat/linux-nat.h
@@ -30,6 +30,10 @@ struct arch_lwp_info;
 #define __SIGRTMIN 32
 #endif
 
+#ifndef W_STOPCODE
+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#endif
+
 /* Unlike other extended result codes, WSTOPSIG (status) on
    PTRACE_O_TRACESYSGOOD syscall events doesn't return SIGTRAP, but
    instead SIGTRAP with bit 7 set.  */
-- 
2.6.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]