aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-05-10 15:10:36 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-05-10 15:10:36 +0000
commit447db2139a6f6883183a7a750c5849145fd29899 (patch)
tree116ab50e4e595e67ea93e7d19daef38aa3223bf4 /linux-user/main.c
parent564c8f9978499a12fc8efd8d3c4af54060d1adcf (diff)
sigtrap support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@147 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index c9d0c98604..00dc271778 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -166,7 +166,7 @@ void cpu_loop(CPUX86State *env)
break;
case EXCP00_DIVZ:
if (env->eflags & VM_MASK) {
- do_int(env, trapnr);
+ handle_vm86_trap(env, trapnr);
} else {
/* division by zero */
info.si_signo = SIGFPE;
@@ -176,10 +176,27 @@ void cpu_loop(CPUX86State *env)
queue_signal(info.si_signo, &info);
}
break;
+ case EXCP01_SSTP:
+ case EXCP03_INT3:
+ if (env->eflags & VM_MASK) {
+ handle_vm86_trap(env, trapnr);
+ } else {
+ info.si_signo = SIGTRAP;
+ info.si_errno = 0;
+ if (trapnr == EXCP01_SSTP) {
+ info.si_code = TARGET_TRAP_BRKPT;
+ info._sifields._sigfault._addr = env->eip;
+ } else {
+ info.si_code = TARGET_SI_KERNEL;
+ info._sifields._sigfault._addr = 0;
+ }
+ queue_signal(info.si_signo, &info);
+ }
+ break;
case EXCP04_INTO:
case EXCP05_BOUND:
if (env->eflags & VM_MASK) {
- do_int(env, trapnr);
+ handle_vm86_trap(env, trapnr);
} else {
info.si_signo = SIGSEGV;
info.si_errno = 0;