* [csl-am] missing SIGTRAP
@ 2005-04-29 14:18 Paul Brook
2005-07-25 15:04 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2005-04-29 14:18 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
It appears that the builtin simulators use host signal numbers to communicate
with gdb. This causes problems on windows hosts because SIGTRAP isn't
defined. The attached patch provides a definition for SIGTRAP if the host
doesn't have one. This probably isn't the "right way" to fix this, but it's
near enough for our purposes.
Applied to csl-arm-20050325-branch.
Paul
2005-04-29 Paul Brook <paul@codesourcery.com>
* gdb/remote-sim.c (SIGTRAP): Provide default defnition.
* gdb/signals/signals.c (SIGRAP): Ditto.
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1074 bytes --]
Index: gdb/remote-sim.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/gdb/remote-sim.c,v
retrieving revision 1.46.2.1
diff -u -p -r1.46.2.1 remote-sim.c
--- gdb/remote-sim.c 29 Mar 2005 02:52:05 -0000 1.46.2.1
+++ gdb/remote-sim.c 28 Apr 2005 00:58:33 -0000
@@ -44,6 +44,10 @@
#include "sim-regno.h"
#include "arch-utils.h"
+#ifndef SIGTRAP
+#define SIGTRAP 5
+#endif
+
/* Prototypes */
extern void _initialize_remote_sim (void);
Index: gdb/signals/signals.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/gdb/signals/signals.c,v
retrieving revision 1.9
diff -u -p -r1.9 signals.c
--- gdb/signals/signals.c 8 Jun 2003 18:27:14 -0000 1.9
+++ gdb/signals/signals.c 28 Apr 2005 14:47:13 -0000
@@ -30,6 +30,10 @@
#include <signal.h>
+#ifndef SIGTRAP
+#define SIGTRAP 5
+#endif
+
/* Always use __SIGRTMIN if it's available. SIGRTMIN is the lowest
_available_ realtime signal, not the lowest supported; glibc takes
several for its own use. */
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [csl-am] missing SIGTRAP
2005-04-29 14:18 [csl-am] missing SIGTRAP Paul Brook
@ 2005-07-25 15:04 ` Daniel Jacobowitz
2005-07-25 18:00 ` Mark Kettenis
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-07-25 15:04 UTC (permalink / raw)
To: Paul Brook; +Cc: gdb-patches
On Fri, Apr 29, 2005 at 03:18:04PM +0100, Paul Brook wrote:
> It appears that the builtin simulators use host signal numbers to communicate
> with gdb. This causes problems on windows hosts because SIGTRAP isn't
> defined. The attached patch provides a definition for SIGTRAP if the host
> doesn't have one. This probably isn't the "right way" to fix this, but it's
> near enough for our purposes.
>
> Applied to csl-arm-20050325-branch.
>
> Paul
>
> 2005-04-29 Paul Brook <paul@codesourcery.com>
>
> * gdb/remote-sim.c (SIGTRAP): Provide default defnition.
> * gdb/signals/signals.c (SIGRAP): Ditto.
I was going to ignore this patch for mainline, since it indeed isn't
the right way. Then I took a look at the simulators and how much of a
PAIN it's going to be to migrate them off of host signal numbers.
Does anyone object to the inclusion of this patch?
> Index: gdb/remote-sim.c
> ===================================================================
> RCS file: /var/cvsroot/src-cvs/src/gdb/remote-sim.c,v
> retrieving revision 1.46.2.1
> diff -u -p -r1.46.2.1 remote-sim.c
> --- gdb/remote-sim.c 29 Mar 2005 02:52:05 -0000 1.46.2.1
> +++ gdb/remote-sim.c 28 Apr 2005 00:58:33 -0000
> @@ -44,6 +44,10 @@
> #include "sim-regno.h"
> #include "arch-utils.h"
>
> +#ifndef SIGTRAP
> +#define SIGTRAP 5
> +#endif
> +
> /* Prototypes */
>
> extern void _initialize_remote_sim (void);
> Index: gdb/signals/signals.c
> ===================================================================
> RCS file: /var/cvsroot/src-cvs/src/gdb/signals/signals.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 signals.c
> --- gdb/signals/signals.c 8 Jun 2003 18:27:14 -0000 1.9
> +++ gdb/signals/signals.c 28 Apr 2005 14:47:13 -0000
> @@ -30,6 +30,10 @@
>
> #include <signal.h>
>
> +#ifndef SIGTRAP
> +#define SIGTRAP 5
> +#endif
> +
> /* Always use __SIGRTMIN if it's available. SIGRTMIN is the lowest
> _available_ realtime signal, not the lowest supported; glibc takes
> several for its own use. */
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [csl-am] missing SIGTRAP
2005-07-25 15:04 ` Daniel Jacobowitz
@ 2005-07-25 18:00 ` Mark Kettenis
2005-07-25 18:06 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2005-07-25 18:00 UTC (permalink / raw)
To: drow; +Cc: paul, gdb-patches
Date: Mon, 25 Jul 2005 11:04:54 -0400
From: Daniel Jacobowitz <drow@false.org>
On Fri, Apr 29, 2005 at 03:18:04PM +0100, Paul Brook wrote:
> It appears that the builtin simulators use host signal numbers to
> communicate with gdb. This causes problems on windows hosts
> because SIGTRAP isn't defined. The attached patch provides a
> definition for SIGTRAP if the host doesn't have one. This
> probably isn't the "right way" to fix this, but it's near enough
> for our purposes.
>
> Applied to csl-arm-20050325-branch.
>
> Paul
>
> 2005-04-29 Paul Brook <paul@codesourcery.com>
>
> * gdb/remote-sim.c (SIGTRAP): Provide default defnition.
> * gdb/signals/signals.c (SIGRAP): Ditto.
I was going to ignore this patch for mainline, since it indeed isn't
the right way. Then I took a look at the simulators and how much of a
PAIN it's going to be to migrate them off of host signal numbers.
Does anyone object to the inclusion of this patch?
The problem here is the fact that the simulator tries to map host
events and simulator events to the same thing isn't it? I'm not too
concerned with the simulators, but I think someone who does care
should really fix this. Meanwhile I don't object to a local hack in
gdb/remote-sim.c.
However, I *do* object to the change to gdb/signals/signals.c. This
is supposed to be a host to target mapping of signals. Making it
pretend that the host has SIGTRAP while it doesn't is a truly bad
thing to do.
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [csl-am] missing SIGTRAP
2005-07-25 18:00 ` Mark Kettenis
@ 2005-07-25 18:06 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-07-25 18:06 UTC (permalink / raw)
To: Mark Kettenis; +Cc: paul, gdb-patches
On Mon, Jul 25, 2005 at 07:59:04PM +0200, Mark Kettenis wrote:
> I was going to ignore this patch for mainline, since it indeed isn't
> the right way. Then I took a look at the simulators and how much of a
> PAIN it's going to be to migrate them off of host signal numbers.
>
> Does anyone object to the inclusion of this patch?
>
> The problem here is the fact that the simulator tries to map host
> events and simulator events to the same thing isn't it? I'm not too
> concerned with the simulators, but I think someone who does care
> should really fix this. Meanwhile I don't object to a local hack in
> gdb/remote-sim.c.
No, I think that the problem is simpler than that. The simulator
doesn't care about host events. It's mapping target events to signal
numbers; it just picked the SIG* numbers instead of the TARGET_SIGNAL_*
numbers. Which are only recently (in the grand scheme of things -
about three years ago) available in include/gdb/.
> However, I *do* object to the change to gdb/signals/signals.c. This
> is supposed to be a host to target mapping of signals. Making it
> pretend that the host has SIGTRAP while it doesn't is a truly bad
> thing to do.
Well then the hack in remote-sim.c will have to be a bit more
intrusive... it calls target_signal_to_host and target_signal_from_host
on this value. That's doable.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-07-25 18:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-29 14:18 [csl-am] missing SIGTRAP Paul Brook
2005-07-25 15:04 ` Daniel Jacobowitz
2005-07-25 18:00 ` Mark Kettenis
2005-07-25 18:06 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox