From 336b15cf0f0122448ec3c9faa7cfbdc0120b58a4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 28 Feb 2005 00:42:01 +0000 Subject: [PATCH] Added musings about where to deal with debug registers. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11506 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/arch/x86/arch_int.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/kernel/core/arch/x86/arch_int.c b/src/kernel/core/arch/x86/arch_int.c index 8bcdcea63f..52b154c05b 100755 --- a/src/kernel/core/arch/x86/arch_int.c +++ b/src/kernel/core/arch/x86/arch_int.c @@ -306,6 +306,18 @@ i386_handle_trap(struct iframe frame) if (thread) i386_pop_iframe(thread); + +// ToDo: Somewhere around here (maybe in int_bottom), we need to update some of +// the debug registers, if the thread is a userland thread. +// * (t_to->debug_info.flags & B_THREAD_DEBUG_SINGLE_STEP) indicates whether we +// shall set the TF flags in EFLAGS. We probably best manipulate the +// value on the stack, so that the flag is set by iret and applies to the +// next userland instruction first. +// * Break- and watchpoints are probably best dealt with in +// arch_thread_context_switch(). At least DR0-DR3 should be set there. +// DR7 (the debug control register) is better updated here. +// * int_bottom should always disable break- and watchpoints (by setting +// DR7 accordingly). }