Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH, RFC]: Change order of setting i386 debug registers
@ 2001-03-31  7:56 Mark Kettenis
  2001-03-31  8:23 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2001-03-31  7:56 UTC (permalink / raw)
  To: eli; +Cc: gdb-patches

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;
 	}


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-31  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-31  7:56 [PATCH, RFC]: Change order of setting i386 debug registers Mark Kettenis
2001-03-31  8:23 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox