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/remote-udi.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/remote-udi.c')
-rw-r--r-- | gdb/remote-udi.c | 67 |
1 files changed, 45 insertions, 22 deletions
diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index 3afc02f..6f32c00 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -361,7 +361,8 @@ udi_detach (args,from_tty) static void udi_resume (pid, step, sig) - int pid, step, sig; + int pid, step; + enum target_signal sig; { UDIError tip_error; UDIUInt32 Steps = 1; @@ -389,7 +390,7 @@ udi_resume (pid, step, sig) static int udi_wait (pid, status) int pid; - WAITTYPE *status; + struct target_waitstatus *status; { UDIInt32 MaxTime; UDIPId PId; @@ -399,7 +400,8 @@ udi_wait (pid, status) int old_immediate_quit = immediate_quit; int i; - WSETEXIT ((*status), 0); + status->kind = TARGET_WAITKIND_EXITED; + status->value.integer = 0; /* wait for message to arrive. It should be: If the target stops executing, udi_wait() should return. @@ -467,17 +469,22 @@ udi_wait (pid, status) { case 0: /* Illegal opcode */ printf_unfiltered(" (break point)\n"); - WSETSTOP ((*status), SIGTRAP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; break; case 1: /* Unaligned Access */ - WSETSTOP ((*status), SIGBUS); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_BUS; break; case 3: case 4: - WSETSTOP ((*status), SIGFPE); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_FPE; break; case 5: /* Protection Violation */ - WSETSTOP ((*status), SIGILL); + status->kind = TARGET_WAITKIND_STOPPED; + /* Why not SEGV? What is a Protection Violation? */ + status->value.sig = TARGET_SIGNAL_ILL; break; case 6: case 7: @@ -485,17 +492,21 @@ udi_wait (pid, status) case 9: /* User Data Mapping Miss */ case 10: /* Supervisor Instruction Mapping Miss */ case 11: /* Supervisor Data Mapping Miss */ - WSETSTOP ((*status), SIGSEGV); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_SEGV; break; case 12: case 13: - WSETSTOP ((*status), SIGILL); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_ILL; break; case 14: /* Timer */ - WSETSTOP ((*status), SIGALRM); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_ALRM; break; case 15: /* Trace */ - WSETSTOP ((*status), SIGTRAP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; break; case 16: /* INTR0 */ case 17: /* INTR1 */ @@ -503,40 +514,52 @@ udi_wait (pid, status) case 19: /* INTR3/Internal */ case 20: /* TRAP0 */ case 21: /* TRAP1 */ - WSETSTOP ((*status), SIGINT); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_INT; break; case 22: /* Floating-Point Exception */ - WSETSTOP ((*status), SIGILL); + status->kind = TARGET_WAITKIND_STOPPED; + /* Why not FPE? */ + status->value.sig = TARGET_SIGNAL_ILL; break; case 77: /* assert 77 */ - WSETSTOP ((*status), SIGTRAP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; break; default: - WSETEXIT ((*status), 0); + status->kind = TARGET_WAITKIND_EXITED; + status->value.integer = 0; } break; case UDINotExecuting: - WSETSTOP ((*status), SIGTERM); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TERM; break; case UDIStopped: - WSETSTOP ((*status), SIGTSTP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TSTP; break; case UDIWarned: - WSETSTOP ((*status), SIGURG); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_URG; break; case UDIStepped: case UDIBreak: - WSETSTOP ((*status), SIGTRAP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; break; case UDIWaiting: - WSETSTOP ((*status), SIGSTOP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_STOP; break; case UDIHalted: - WSETSTOP ((*status), SIGKILL); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_KILL; break; case UDIExited: default: - WSETEXIT ((*status), 0); + status->kind = TARGET_WAITKIND_EXITED; + status->value.integer = 0; } timeout = old_timeout; /* Restore original timeout value */ |