This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH, RFC]: Change order of setting i386 debug registers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]