aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-12-07 03:56:43 +0000
committerJason Molenda <jmolenda@apple.com>1999-12-07 03:56:43 +0000
commitc2d11a7da0372ef052af1c74d56e264d8aae4743 (patch)
treeb2ceadb275bb9a170315ab66111c1f643c9ebf71 /gdb/target.c
parent1e37c28164d4f504b2ae8189d0b82a862cfa323d (diff)
downloadgdb-c2d11a7da0372ef052af1c74d56e264d8aae4743.zip
gdb-c2d11a7da0372ef052af1c74d56e264d8aae4743.tar.gz
gdb-c2d11a7da0372ef052af1c74d56e264d8aae4743.tar.bz2
import gdb-1999-12-06 snapshot
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 3a6e423..a74e362 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1675,10 +1675,16 @@ target_signal_from_host (hostsig)
return TARGET_SIGNAL_UNKNOWN;
}
-int
-target_signal_to_host (oursig)
- enum target_signal oursig;
+/* Convert a OURSIG (an enum target_signal) to the form used by the
+ target operating system (refered to as the ``host'') or zero if the
+ equivalent host signal is not available. Set/clear OURSIG_OK
+ accordingly. */
+
+static int
+do_target_signal_to_host (enum target_signal oursig,
+ int *oursig_ok)
{
+ *oursig_ok = 1;
switch (oursig)
{
case TARGET_SIGNAL_0:
@@ -1913,12 +1919,34 @@ target_signal_to_host (oursig)
return retsig;
}
#endif
+ *oursig_ok = 0;
+ return 0;
+ }
+}
+
+int
+target_signal_to_host_p (enum target_signal oursig)
+{
+ int oursig_ok;
+ do_target_signal_to_host (oursig, &oursig_ok);
+ return oursig_ok;
+}
+
+int
+target_signal_to_host (enum target_signal oursig)
+{
+ int oursig_ok;
+ int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
+ if (!oursig_ok)
+ {
/* The user might be trying to do "signal SIGSAK" where this system
doesn't have SIGSAK. */
warning ("Signal %s does not exist on this system.\n",
target_signal_to_name (oursig));
return 0;
}
+ else
+ return targ_signo;
}
/* Helper function for child_wait and the Lynx derivatives of child_wait.