public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Samuel Thibault <samuel.thibault@gnu.org>
Cc: <bug-hurd@gnu.org>, <gdb-patches@sourceware.org>
Subject: Re: [PATCHv3,Hurd] Add hardware watch support
Date: Tue, 16 Sep 2014 09:00:00 -0000	[thread overview]
Message-ID: <87iokondoc.fsf@schwinge.name> (raw)
In-Reply-To: <20140915230950.GB2942@type.youpi.perso.aquilenet.fr>

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

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 #2: Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2014-09-16  9:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 22:49 Samuel Thibault
2014-09-10 23:23 ` Sergio Durigan Junior
2014-09-12 18:21   ` Samuel Thibault
2014-09-12 19:18     ` Sergio Durigan Junior
2014-09-12 16:51 ` Joel Brobecker
2014-09-12 18:24   ` Samuel Thibault
2014-09-12 17:56 ` Thomas Schwinge
2014-09-12 18:01   ` Samuel Thibault
2014-09-12 20:01     ` Joel Brobecker
2014-09-12 21:24       ` Samuel Thibault
2014-09-12 21:42         ` Sergio Durigan Junior
2014-09-15 13:50         ` Joel Brobecker
2014-09-12 18:25   ` Samuel Thibault
2014-09-15 22:08   ` Thomas Schwinge
2014-09-15 23:09     ` Samuel Thibault
2014-09-16  9:00       ` Thomas Schwinge [this message]
2014-09-16 23:17         ` Samuel Thibault
2014-09-16 23:29           ` Samuel Thibault
2014-09-17  9:02           ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iokondoc.fsf@schwinge.name \
    --to=thomas@codesourcery.com \
    --cc=bug-hurd@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).