This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Do not use internal definition of SIGRTMIN
- From: Doug Evans <dje at google dot com>
- To: Khem Raj <raj dot khem at gmail dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Sat, 31 Oct 2015 18:12:11 -0700
- Subject: Re: [PATCH] Do not use internal definition of SIGRTMIN
- Authentication-results: sourceware.org; auth=none
- References: <1446317977-24319-1-git-send-email-raj dot khem at gmail dot com>
On Sat, Oct 31, 2015 at 11:59 AM, Khem Raj <raj.khem@gmail.com> wrote:
> 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
>
Hi.
These patches look remarkably similar to mine that I recently checked in.
Porting gdb to musl?
2015-10-26 Doug Evans <dje@google.com>
* nat/linux-nat.h (__SIGRTMIN): Move here from gdbserver/linux-low.c.
2015-10-26 Doug Evans <dje@google.com>
* common/gdb_wait.h (W_STOPCODE): Define, moved here from
gdbserver/linux-low.c.
(WSETSTOP): Simplify.