bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv3,Hurd] Add hardware watch support


From: Thomas Schwinge
Subject: Re: [PATCHv3,Hurd] Add hardware watch support
Date: Tue, 16 Sep 2014 10:59:47 +0200
User-agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

Hi Samuel!

On Tue, 16 Sep 2014 01:09:50 +0200, Samuel Thibault <samuel.thibault@gnu.org> 
wrote:
> Thomas Schwinge, le Tue 16 Sep 2014 00:08:01 +0200, a écrit :
> > Do you agree that thread_get_state(i386_DEBUG_STATE) should be
> > returning the actual DR6,
> 
> Indeed.
> 
> > and where in GNU Mach would we need to copy the DR6
> > register into the PCB?
> 
> it would be user_trap(), probably, in the T_DEBUG case.

Thanks for the pointer.  Something like the following does accomplish its
task w.r.t. GDB, but there are some TODO items.  It might help to compare
what the Linux kernel is doing; »git grep --cached -i dr6 -- arch/x86/«
or similar.

diff -ru gnumach-1.4.orig/i386/i386/trap.c gnumach-1.4/i386/i386/trap.c
--- gnumach-1.4.orig/i386/i386/trap.c   2013-09-27 08:05:57.000000000 +0200
+++ gnumach-1.4/i386/i386/trap.c        2014-09-16 10:45:58.000000000 +0200
@@ -404,6 +404,17 @@
                        return 0;
                }
 #endif
+
+               /* Make the content of the debug status register (DR6)
+                  available to user space.  */
+               /* TODO: Do we have to sanitize its content?  (Mask out
+                  reserved bits?)  */
+               /* TODO: Where should its content be reset (zeroed)?  From user
+                  space?  */
+               /* TODO: Anything to take care about w.r.t interaction with
+                  KDB?  */
+               thread->pcb->ims.ids.dr[6] = get_dr6();
+
                exc = EXC_BREAKPOINT;
                code = EXC_I386_SGL;
                break;


Grüße,
 Thomas

Attachment: pgpSUGVN3dl9L.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]