lkml.org 
[lkml]   [1999]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectptrace, i386 and DR6 register
Hi,

I'm currently toying with ptrace interface on my 2.2.9 / i386 kernel

I do have issues with the debug registers.

what I'd like to be able to do, is, in the superior process, after
a wait returning a stop for a TRAP on the attached process, to read
DR6 with ptrace(PEEK_USER,...) to know which DR[0..3] has triggered
the trap (if any)

all my attemps always result in DR6 being 0

after looking at the code (but I may be plain wrong), it seems
that DR6 (debugreg[6]) is never updated

would something like this (on arch/i386/kernel/traps.c) do ?
--- traps.c.orig Sat Nov 13 15:27:22 1999
+++ traps.c Sat Nov 13 15:29:28 1999
@@ -391,7 +391,9 @@
return;

debug_vm86:
+ __asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
lock_kernel();
+ tsk->tss.debugreg[6] = condition & ~(DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3);
handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1);
unlock_kernel();
return;
THX

A+
--
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.037 / U:2.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site