aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-03-26 16:29:39 +0000
committerDaniel Jacobowitz <drow@false.org>2003-03-26 16:29:39 +0000
commit960cb5556f18d309e5ac4d082b76b281f5e27dd2 (patch)
tree4b4a383d86a3dafdbe80b51483a3690752933d82
parenta5ad465accd73e8c7abeda27341b22470ad5d27d (diff)
downloadgdb-960cb5556f18d309e5ac4d082b76b281f5e27dd2.zip
gdb-960cb5556f18d309e5ac4d082b76b281f5e27dd2.tar.gz
gdb-960cb5556f18d309e5ac4d082b76b281f5e27dd2.tar.bz2
* signals/signals.c (REALTIME_LO, REALTIME_HI): Define if
not already defined. Use __SIGRTMIN if available. (target_signal_from_host): Remove SIGRTMIN block. (do_target_signal_to_host): Remove SIGRTMIN block; check that the signal is within the realtime range.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/signals/signals.c68
2 files changed, 27 insertions, 49 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4589ece..a1df35d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2003-03-26 Daniel Jacobowitz <drow@mvista.com>
+
+ * signals/signals.c (REALTIME_LO, REALTIME_HI): Define if
+ not already defined. Use __SIGRTMIN if available.
+ (target_signal_from_host): Remove SIGRTMIN block.
+ (do_target_signal_to_host): Remove SIGRTMIN block; check that
+ the signal is within the realtime range.
+
2003-03-25 Adam Fedor <fedor@gnu.org>
* Makefile.in (infrun.o): Add $(language_h)
diff --git a/gdb/signals/signals.c b/gdb/signals/signals.c
index 82c63d8..ad19951 100644
--- a/gdb/signals/signals.c
+++ b/gdb/signals/signals.c
@@ -30,6 +30,20 @@
#include <signal.h>
+/* 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. */
+
+#ifndef REALTIME_LO
+# if defined(__SIGRTMIN)
+# define REALTIME_LO __SIGRTMIN
+# define REALTIME_HI __SIGRTMAX
+# elif defined(SIGRTMIN)
+# define REALTIME_LO __SIGRTMIN
+# define REALTIME_HI __SIGRTMAX
+# endif
+#endif
+
/* This table must match in order and size the signals in enum target_signal
in target.h. */
/* *INDENT-OFF* */
@@ -492,22 +506,6 @@ target_signal_from_host (int hostsig)
}
#endif
-#if defined (SIGRTMIN)
- if (hostsig >= SIGRTMIN && hostsig <= SIGRTMAX)
- {
- /* This block of TARGET_SIGNAL_REALTIME value is in order. */
- if (33 <= hostsig && hostsig <= 63)
- return (enum target_signal)
- (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
- else if (hostsig == 32)
- return TARGET_SIGNAL_REALTIME_32;
- else if (64 <= hostsig && hostsig <= 127)
- return (enum target_signal)
- (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
- else
- error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
- }
-#endif
return TARGET_SIGNAL_UNKNOWN;
}
@@ -744,40 +742,12 @@ do_target_signal_to_host (enum target_signal oursig,
default:
#if defined (REALTIME_LO)
- if (oursig >= TARGET_SIGNAL_REALTIME_33
- && oursig <= TARGET_SIGNAL_REALTIME_63)
+ if (oursig < REALTIME_LO || oursig >= REALTIME_HI)
{
- /* This block of signals is continuous, and
- TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
- int retsig =
- (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
- if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
- return retsig;
- }
-#if (REALTIME_LO < 33)
- else if (oursig == TARGET_SIGNAL_REALTIME_32)
- {
- /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
- TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */
- return 32;
- }
-#endif
-#if (REALTIME_HI > 64)
- if (oursig >= TARGET_SIGNAL_REALTIME_64
- && oursig <= TARGET_SIGNAL_REALTIME_127)
- {
- /* This block of signals is continuous, and
- TARGET_SIGNAL_REALTIME_64 is 64 by definition. */
- int retsig =
- (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
- if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
- return retsig;
+ *oursig_ok = 0;
+ return 0;
}
-
-#endif
-#endif
-#if defined (SIGRTMIN)
if (oursig >= TARGET_SIGNAL_REALTIME_33
&& oursig <= TARGET_SIGNAL_REALTIME_63)
{
@@ -785,8 +755,7 @@ do_target_signal_to_host (enum target_signal oursig,
TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
int retsig =
(int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
- if (retsig >= SIGRTMIN && retsig <= SIGRTMAX)
- return retsig;
+ return retsig;
}
else if (oursig == TARGET_SIGNAL_REALTIME_32)
{
@@ -804,6 +773,7 @@ do_target_signal_to_host (enum target_signal oursig,
return retsig;
}
#endif
+
*oursig_ok = 0;
return 0;
}