diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-02-09 05:08:42 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-02-09 05:08:42 +0000 |
commit | 7fc5b5adca549dda57f47043626d22c3f1e94430 (patch) | |
tree | cdef0374ca62b628a043bf132ec07913b53edb2d /sim/common/run.c | |
parent | Stop GDB mis-aligning the stack when doing inferior function calls. (diff) | |
download | binutils-gdb-7fc5b5adca549dda57f47043626d22c3f1e94430.tar.gz binutils-gdb-7fc5b5adca549dda57f47043626d22c3f1e94430.tar.bz2 binutils-gdb-7fc5b5adca549dda57f47043626d22c3f1e94430.zip |
Report SIGBUS and halt simulation when ld/st detect a misaligned address.
Diffstat (limited to 'sim/common/run.c')
-rw-r--r-- | sim/common/run.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sim/common/run.c b/sim/common/run.c index a3e38a8e0b8..1a4e96908f1 100644 --- a/sim/common/run.c +++ b/sim/common/run.c @@ -231,26 +231,30 @@ main (ac, av) if (sim_create_inferior (sd, abfd, prog_args, NULL) == SIM_RC_FAIL) exit (1); - prev_sigint = signal (SIGINT, cntrl_c); if (trace) { int done = 0; + prev_sigint = signal (SIGINT, cntrl_c); while (!done) { done = sim_trace (sd); } + signal (SIGINT, prev_sigint); } else { - sim_resume (sd, 0, 0); + do + { + prev_sigint = signal (SIGINT, cntrl_c); + sim_resume (sd, 0, sigrc); + signal (SIGINT, prev_sigint); + sim_stop_reason (sd, &reason, &sigrc); + } + while (reason == sim_stopped && sigrc != SIGINT); } - signal (SIGINT, prev_sigint); if (verbose) sim_info (sd, 0); - - sim_stop_reason (sd, &reason, &sigrc); - sim_close (sd, 0); /* If reason is sim_exited, then sigrc holds the exit code which we want |