Signal definitions for host=mingw32/target=*-*-*

Eli Zaretskii eliz@gnu.org
Sat Apr 15 18:25:00 GMT 2006


> From: Masaki MURANAKA <monaka@monami-software.com>
> Date: Sun, 16 Apr 2006 01:36:44 +0900
> 
> This is a patch that enables to build cross debuggers
> on MinGW.
> The base version of this patch is gdb-6.4.
> 
> I've built m32r-elf-gdb with it and checked to work.

Thanks.

> ----
> 2006-04-16  Masaki MURANAKA  <monaka@monami-software.com>
> 
>          * sim-signal.c: On MinGW, Added some signal definitions.
> 		They are not defined in Win32's signal.h.
>          * remote-sim.c: Same above.
> ----
> 
> Index: sim/common/sim-signal.c
> ===================================================================
> RCS file: /home/cvs/pizzafactory/gdb/sim/common/sim-signal.c,v
> retrieving revision 1.3
> diff -r1.3 sim-signal.c
> 30c30
> < #ifdef _MSC_VER
> ---
>  > #if defined(_MSC_VER) || defined(__MINGW32__)
> Index: gdb/remote-sim.c
> ===================================================================
> RCS file: /home/cvs/pizzafactory/gdb/gdb/remote-sim.c,v
> retrieving revision 1.4
> diff -r1.4 remote-sim.c
> 46a47,58
>  > #if defined(_MSC_VER) || defined(__MINGW32__)
>  > #ifndef SIGTRAP
>  > #define SIGTRAP 5
>  > #endif
>  > #ifndef SIGBUS
>  > #define SIGBUS 10
>  > #endif
>  > #ifndef SIGQUIT
>  > #define SIGQUIT 3
>  > #endif
>  > #endif

Sorry, this is not the way to fix such problems.  You cannot add
arbitrary signals to a runtime that doesn't support them.

The right way to fix such problems is to ifdef out the code that uses
these signals.  For example:

 #ifdef SIGTRAP
 ... code that uses SIGTRAP ...
 #endif

(Yes, I know that sim-signal does add these definitions conditioned on
_MSC_VER, but I think that's wrong and should be deleted.)

Btw, I don't see these signals used anywhere in remote-sim.c.  Why did
you need to add them?



More information about the Gdb-patches mailing list