aboutsummaryrefslogtreecommitdiff
path: root/linux-user/nios2
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/nios2')
-rw-r--r--linux-user/nios2/cpu_loop.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c
index dac7a06181..b96b1aa119 100644
--- a/linux-user/nios2/cpu_loop.c
+++ b/linux-user/nios2/cpu_loop.c
@@ -26,13 +26,12 @@ void cpu_loop(CPUNios2State *env)
CPUState *cs = ENV_GET_CPU(env);
Nios2CPU *cpu = NIOS2_CPU(cs);
target_siginfo_t info;
- int trapnr, gdbsig, ret;
+ int trapnr, ret;
for (;;) {
cpu_exec_start(cs);
trapnr = cpu_exec(cs);
cpu_exec_end(cs);
- gdbsig = 0;
switch (trapnr) {
case EXCP_INTERRUPT:
@@ -68,7 +67,10 @@ void cpu_loop(CPUNios2State *env)
env->regs[R_EA] = env->regs[R_PC] + 4;
env->regs[R_PC] = cpu->exception_addr;
- gdbsig = TARGET_SIGTRAP;
+ info.si_signo = TARGET_SIGTRAP;
+ info.si_errno = 0;
+ info.si_code = TARGET_TRAP_BRKPT;
+ queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
break;
}
case 0xaa:
@@ -106,14 +108,7 @@ kuser_fail:
default:
EXCP_DUMP(env, "\nqemu: unhandled CPU exception %#x - aborting\n",
trapnr);
- gdbsig = TARGET_SIGILL;
- break;
- }
- if (gdbsig) {
- gdb_handlesig(cs, gdbsig);
- if (gdbsig != TARGET_SIGTRAP) {
- exit(EXIT_FAILURE);
- }
+ abort();
}
process_pending_signals(env);