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]
Other format: [Raw text]

[PATCH] Fix FreeBSD/i386 debug register handling


This patch makes sure this code continues to compile on future FreeBSD
releases.

Mark

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

	* i386bsd-nat.c (i386bsd_dr_set, i386bsd_dr_get_status): Use
	DBREG_DRX macro to acces debug registers.

Index: i386bsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-nat.c,v
retrieving revision 1.17
diff -u -p -r1.17 i386bsd-nat.c
--- i386bsd-nat.c 20 Oct 2002 11:54:40 -0000 1.17
+++ i386bsd-nat.c 20 Oct 2002 21:17:37 -0000
@@ -306,7 +306,7 @@ i386bsd_dr_set (int regnum, unsigned int
   /* For some mysterious reason, some of the reserved bits in the
      debug control register get set.  Mask these off, otherwise the
      ptrace call below will fail.  */
-  dbregs.dr7 &= ~(0x0000fc00);
+  DBREG_DRX ((&dbregs), 7) &= ~(0x0000fc00);
 
   DBREG_DRX ((&dbregs), regnum) = value;
 
@@ -355,7 +355,7 @@ i386bsd_dr_get_status (void)
     return 0;
 #endif
 
-  return dbregs.dr6;
+  return DBREG_DRX ((&dbregs), 6);
 }
 
 #endif /* PT_GETDBREGS */


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