Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@wins.uva.nl>
To: eli@gnu.org
Cc: gdb-patches@sources.redhat.com
Subject: [PATCH, RFC]: Change order of setting i386 debug registers
Date: Sat, 31 Mar 2001 07:56:00 -0000	[thread overview]
Message-ID: <200103311556.f2VFu2O00222@delius.kettenis.local> (raw)

Hi Eli,

FreeBSD/i386 does some strict checking on the debug registers before
setting them.  This conflicts a bit with the order in which the code
in i386-nat.c tries to set the registers.  The attached patch fixes
these problems by changing the order in which we modify the
registers.  Instead of enabling an address register before storing the
proper address in it, after the patch, we will first store the address
and then enable the address register.  This seems more correct to me.

Any objections to checking this in?

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i386-nat.c (i386_insert_aligned_watchpoint): Set address
	register before enabling it by setting the control register.
	(i386_remove_aligned_watchpoint): Reset address register after
	disabling it by setting the control register.

Index: i386-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nat.c,v
retrieving revision 1.1
diff -u -p -r1.1 i386-nat.c
--- i386-nat.c 2001/03/21 11:36:56 1.1
+++ i386-nat.c 2001/03/31 15:47:54
@@ -356,8 +356,8 @@ i386_insert_aligned_watchpoint (CORE_ADD
   dr_control_mirror &= I386_DR_CONTROL_MASK;
 
   /* Finally, actually pass the info to the inferior.  */
-  I386_DR_LOW_SET_CONTROL (dr_control_mirror);
   I386_DR_LOW_SET_ADDR (i, addr);
+  I386_DR_LOW_SET_CONTROL (dr_control_mirror);
 
   return 0;
 }
@@ -384,8 +384,8 @@ i386_remove_aligned_watchpoint (CORE_ADD
 	      dr_mirror[i] = 0;
 	      I386_DR_DISABLE (i);
 	      /* Reset it in the inferior.  */
-	      I386_DR_LOW_RESET_ADDR (i);
 	      I386_DR_LOW_SET_CONTROL (dr_control_mirror);
+	      I386_DR_LOW_RESET_ADDR (i);
 	    }
 	  retval = 0;
 	}


             reply	other threads:[~2001-03-31  7:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-31  7:56 Mark Kettenis [this message]
2001-03-31  8:23 ` Eli Zaretskii

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=200103311556.f2VFu2O00222@delius.kettenis.local \
    --to=kettenis@wins.uva.nl \
    --cc=eli@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /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