[PATCH] Fix for target.c:do_target_signal_to_host()

Andrew Cagney ac131313@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


Mark Kettenis wrote:
> 
> Hi,
> 
> I noticed that under Linux, if I send a RT signal N to the program I'm
> debugging, GDB actually sends signal N - 1, e.g. if you continue with
> 
> signal SIG35
> 
> GDB will tell you that the program terminated with SIG34.
> 
> The appended patch fixes this.

If you add a comment noting that:

	o	TARGET_SIGNAL_REALTIME_32 isn't
		contigious with TARGET_SIGNAL_REALTIME_32

	o	TARGET_SIGNAL_REALTIME_33 is 33 by defintion.

then it can go straight in.

	Andrew


> 
> Mark
> 
> 2000-02-14  Mark Kettenis  <kettenis@gnu.org>
> 
>         * target.c (do_target_signal_to_host): Do not use REALTIME_LO in
>         the conversion of the signal number.  TARGET_SIGNAL_REALTIME_33 is
>         33 by definition, whereas REALTIME_LO might be 32 on systems that
>         have SIG32 such as Linux.
> 
> Index: gdb/target.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/target.c,v
> retrieving revision 1.2
> diff -u -r1.2 target.c
> --- gdb/target.c        2000/02/09 08:52:47     1.2
> +++ gdb/target.c        2000/02/14 21:09:27
> @@ -2061,7 +2061,7 @@
>           && oursig <= TARGET_SIGNAL_REALTIME_63)
>         {
>           int retsig =
> -         (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + REALTIME_LO;
> +           (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
>           if (retsig < REALTIME_HI)
>             return retsig;
>         }


More information about the Gdb-patches mailing list