summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-09-17 01:50:05 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-09-17 01:50:05 +0200
commit96cec60d956bfb27f135d4e932a1c319cbc878df (patch)
treecf5c24b302c1e3950075cdddee67f9539a24642c
parent5ae510e35c54009626999a88f0f1cb34d6dfc94f (diff)
Report DR6 to userland
* i386/i386/trap.c (user_trap): On T_DEBUG, record the content of dr6 in PCB, and clear it.
-rw-r--r--i386/i386/trap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 200cbcc..9d4d43d 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -395,6 +395,11 @@ printf("user trap %d error %d sub %08x\n", type, code, subcode);
return 0;
}
#endif /* MACH_KDB */
+ /* Make the content of the debug status register (DR6)
+ available to user space. */
+ if (thread->pcb)
+ thread->pcb->ims.ids.dr[6] = get_dr6() & 0x600F;
+ set_dr6(0);
exc = EXC_BREAKPOINT;
code = EXC_I386_SGL;
break;