diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-04 21:53:53 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-04 21:53:53 +0000 |
commit | 67ac97591175936a06cc1ef1df228746edcdb545 (patch) | |
tree | eb6068254e2992c5aa83741da1e59bb1af9562f4 /gdb/m3-nat.c | |
parent | e14316e7fe96be0212669a9a4d60608707f66c90 (diff) | |
download | gdb-67ac97591175936a06cc1ef1df228746edcdb545.zip gdb-67ac97591175936a06cc1ef1df228746edcdb545.tar.gz gdb-67ac97591175936a06cc1ef1df228746edcdb545.tar.bz2 |
* target.h: Add enum target_waitkind, enum target_signal, and
struct target_waitstatus. Change status argument to target_wait to
be struct target_waitstatus * instead of int *.
* target.h, infrun.c, all targets: Change type of signal arguments
to resume(), proceed(), and target_resume() from int to enum
target_signal.
* All targets (*_wait, *_resume): Change accordingly.
* infcmd.c (program_info, signal_command), throughout infrun.c,
* fork-child.c, solib.c, hppa-tdep.c, osfsolib.c: Use this stuff.
* convex-xdep.c, convex-tdep.c: Add FIXME's (getting the Convex
signal code stuff right with the new signals would be non-trivial).
* inferior.h (stop_signal): Make it enum target_signal not int.
* target.c, target.h (target_signal_to_string, target_signal_to_name,
target_signal_from_name): New functions.
* inftarg.c, target.h (target_signal_to_host, target_signal_from_host,
store_waitstatus): New functions.
* procfs.c (procfs_notice_signals): Use them.
* i960-tdep.c (i960_fault_to_signal): New function, to replace
print_fault.
* config/i960/tm-i960.h: Don't define PRINT_RANDOM_SIGNAL.
Diffstat (limited to 'gdb/m3-nat.c')
-rw-r--r-- | gdb/m3-nat.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index 60659b9f..66bd679 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -1209,14 +1209,14 @@ int mach_really_waiting; There is no other way to exit this loop. Returns the inferior_pid for rest of gdb. - Side effects: Set unix exit value to *w. - */ + Side effects: Set *OURSTATUS. */ int mach_really_wait (w) - WAITTYPE *w; + struct target_waitstatus *ourstatus; { int pid; kern_return_t ret; + int w; struct msg { mach_msg_header_t header; @@ -1258,7 +1258,7 @@ mach_really_wait (w) { /* Collect Unix exit status for gdb */ - wait3(w, WNOHANG, 0); + wait3(&w, WNOHANG, 0); /* This mess is here to check that the rest of * gdb knows that the inferior died. It also @@ -1267,25 +1267,26 @@ mach_really_wait (w) * has happened to it's children when mach-magic * is applied on them. */ - if ((!WIFEXITED(*w) && WIFSTOPPED(*w)) || - (WIFEXITED(*w) && WEXITSTATUS(*w) > 0377)) + if ((!WIFEXITED(w) && WIFSTOPPED(w)) || + (WIFEXITED(w) && WEXITSTATUS(w) > 0377)) { - WSETEXIT(*w, 0); + WSETEXIT(w, 0); warning ("Using exit value 0 for terminated task"); } - else if (!WIFEXITED(*w)) + else if (!WIFEXITED(w)) { - int sig = WTERMSIG(*w); + int sig = WTERMSIG(w); /* Signals cause problems. Warn the user. */ if (sig != SIGKILL) /* Bad luck if garbage matches this */ warning ("The terminating signal stuff may be nonsense"); else if (sig > NSIG) { - WSETEXIT(*w, 0); + WSETEXIT(w, 0); warning ("Using exit value 0 for terminated task"); } } + store_waitstatus (ourstatus, w); return inferior_pid; } } @@ -1316,10 +1317,11 @@ mach_really_wait (w) if (stopped_in_exception) { /* Get unix state. May be changed in mach3_exception_actions() */ - wait3(w, WNOHANG, 0); + wait3(&w, WNOHANG, 0); - mach3_exception_actions (w, FALSE, "Task"); + mach3_exception_actions (&w, FALSE, "Task"); + store_waitstatus (ourstatus, w); return inferior_pid; } } @@ -3908,7 +3910,7 @@ void m3_resume (pid, step, signal) int pid; int step; - int signal; + enum target_signal signal; { kern_return_t ret; @@ -3938,7 +3940,7 @@ m3_resume (pid, step, signal) vm_read_cache_valid = FALSE; if (signal && inferior_pid > 0) /* Do not signal, if attached by MID */ - kill (inferior_pid, signal); + kill (inferior_pid, target_signal_to_host (signal)); if (step) { |