summaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-12-07 03:56:43 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-12-07 03:56:43 +0000
commitecd8390290ac2bf41f22122ea01924dcd108af34 (patch)
treefc8310b6f500d05013970d228f2993a81dd6b14b /gdb/target.c
parentc13f725cbfef435a3cbc607745a9b917a756c101 (diff)
downloadgdb-ecd8390290ac2bf41f22122ea01924dcd108af34.tar.gz
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 3a6e423d75a..a74e3623b6d 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.