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-mm.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-mm.c')
-rw-r--r-- | gdb/remote-mm.c | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c index b7d3916..91ae155 100644 --- a/gdb/remote-mm.c +++ b/gdb/remote-mm.c @@ -476,10 +476,11 @@ mm_detach (args,from_tty) static void mm_resume (pid, step, sig) - int pid, step, sig; + int pid, step; + enum target_signal sig; { - if (sig) - error ("Can't send signals to a remote MiniMon system."); + if (sig != TARGET_SIGNAL_0) + warning ("Can't send signals to a remote MiniMon system."); if (step) { out_msg_buf->step_msg.code= STEP; @@ -499,14 +500,14 @@ mm_resume (pid, step, sig) static int mm_wait (status) - WAITTYPE *status; + struct target_waitstatus *status; { int i, result; int old_timeout = timeout; int old_immediate_quit = immediate_quit; - WSETEXIT ((*status), 0); - + status->kind = TARGET_WAITKIND_EXITED; + status->value.integer = 0; /* wait for message to arrive. It should be: - A HIF service request. @@ -559,59 +560,78 @@ halted: if (in_msg_buf->halt_msg.trap_number== 0) { printf("Am290*0 received vector number %d (break point)\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGTRAP); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; } else if (in_msg_buf->halt_msg.trap_number== 1) - { printf("Am290*0 received vector number %d\n", - in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGBUS); - } + { + printf("Am290*0 received vector number %d\n", + in_msg_buf->halt_msg.trap_number); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_BUS; + } else if (in_msg_buf->halt_msg.trap_number== 3 || in_msg_buf->halt_msg.trap_number== 4) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGFPE); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_FPE; } else if (in_msg_buf->halt_msg.trap_number== 5) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGILL); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_ILL; } else if (in_msg_buf->halt_msg.trap_number >= 6 && in_msg_buf->halt_msg.trap_number <= 11) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGSEGV); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_SEGV; } else if (in_msg_buf->halt_msg.trap_number== 12 || in_msg_buf->halt_msg.trap_number== 13) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGILL); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_ILL; } else if (in_msg_buf->halt_msg.trap_number== 14) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGALRM); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_ALRM; } else if (in_msg_buf->halt_msg.trap_number== 15) - WSETSTOP ((*status), SIGTRAP); + { + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; + } else if (in_msg_buf->halt_msg.trap_number >= 16 && in_msg_buf->halt_msg.trap_number <= 21) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGINT); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_INT; } else if (in_msg_buf->halt_msg.trap_number== 22) { printf("Am290*0 received vector number %d\n", in_msg_buf->halt_msg.trap_number); - WSETSTOP ((*status), SIGILL); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_ILL; } /* BREAK message was sent */ else if (in_msg_buf->halt_msg.trap_number== 75) - WSETSTOP ((*status), SIGTRAP); + { + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; + } else exit: - WSETEXIT ((*status), 0); + { + status->kind = TARGET_WAITKIND_EXITED; + status->value.integer = 0; + } timeout = old_timeout; /* Restore original timeout value */ immediate_quit = old_immediate_quit; |