This is the mail archive of the gdb-patches@sourceware.org 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]

[RFC] Remove i386 low level debug register function from nm- header file.


Following my first RFC
http://sourceware.org/ml/gdb-patches/2009-03/msg00197.html

and the following answers, I resubmit
a new version where all i386 low level debug register
is contained in a single struct defined in the 
new i386-nat.h header (to comply with DOS file name restrictions
as asked for by Eli).


  Once again, the ChangeLog entry is one of the places
where I don't really know how to handle things exactly...


Pierre Muller
Pascal language support maintainer for GDB

PS: FreeBSD seems to have a amd64 version, 
but nothing that add debug register support for 
this... Is this a FreeBSD kernel restriction
or just something missing in GDB?
Any amd64 FreeBSD user around?

2009-05-10  Pierre Muller  <muller.u-strasbg.fr>

	Remove all i386 debug register low level macros in config tm files.
	(I386_DR_LOW_SET_ADDR, I386_DR_LOW_RESET_ADDR): Remove.
	(I386_DR_LOW_GET_STATUS, I386_DR_LOW_SET_CONTROL): Remove.

	* i386-nat.h: New file (adapted from i386-nat.c).
	(struct i386_dr_low_type): New type.
	(i386_dr_low): New global variable.
	(i386_set_debug_register_legth): New function.
	* i386-nat.c (TARGET_HAS_DR_LEN_8): Update macro.
	(i386_insert_aligned_watchpoint): Replace i386 dr low macros by
	i386_dr_low struct variable fields.
	(i386_remove_aligned_watchpoint): Likewise.
	(i386_stopped_data_address): Likewise.
	(i386_stopped_by_hwbp): Likewise.
	(i386_set_debug_register_length): New function.
	
	* amd64-linux-nat.c: Include "i386-nat.h".
	(_initialize_amd64_linux_nat): Set i386_dr_low variable fields.
	* go32-nat.c (init_go32_ops): Likewise.
	* i386-linux-nat.c (_initialize_i386_linux_nat): Likewise.
	* i386fbsd-nat.c (_initialize_i386fbsd_nat): Likewise.
	* windows-nat.c: Include "i386-nat.h".
	(cygwin_set_dr, cygwin_get_dr6, cygwin_set_dr7): Add prototypes.
	(init_windows_ops): Set i386_dr_low function fields.

	* amd64-windows-nat.c (_initialize_amd64_windows_nat): Call 
	i386_set_debug_register_length.
	* i386-windows-nat.c (_initialize_i386_windows_nat): Likewise.

	* config/i386/nm-cygwin.h: Remove all I386_DR_LOW* macros.
	* config/i386/nm-cygwin64.h: Likewise.
	* config/i386/nm-fbsd.h: Likewise.
	* config/i386/nm-go32.h: Likewise.
	* config/i386/nm-linux.h: Likewise.
	* config/i386/nm-linux64.h: Likewise.

Index: src/gdb/i386-nat.h
===================================================================
RCS file: i386-nat.h
diff -N i386-nat.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/gdb/i386-nat.h	8 May 2009 13:30:51 -0000
@@ -0,0 +1,133 @@
+/* Native-dependent code for the i386.
+
+   Low level functions to implement Oeprating System specific
+   code to manipulate I386 debug registers.
+
+   Copyright (C) 2009
+   Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
+
+#include "config.h"
+#include "defs.h"
+#include "breakpoint.h"
+#include "command.h"
+#include "gdbcmd.h"
+
+#ifndef I386_DR_NAT_H
+#define I386_DR_NAT_H 1
+
+/* Hardware-assisted breakpoints and watchpoints.  */
+
+/* Targets should define this to use the generic x86 watchpoint support.
*/
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+
+/* Add watchpoint methods to the provided target_ops.  
+   Targets defining I386_USE_GENERIC_WATCHPOINTS should call
+   this.  */
+struct target_ops;
+extern void i386_use_watchpoints (struct target_ops *);
+
+/* Clear the reference counts and forget everything we knew about DRi.  */
+extern void i386_cleanup_dregs (void);
+
+/* Insert a watchpoint to watch a memory region which starts at
+   address ADDR and whose length is LEN bytes.  Watch memory accesses
+   of the type TYPE.  Return 0 on success, -1 on failure.  */
+extern int i386_insert_watchpoint (CORE_ADDR addr, int len, int type);
+
+/* Remove a watchpoint that watched the memory region which starts at
+   address ADDR, whose length is LEN bytes, and for accesses of the
+   type TYPE.  Return 0 on success, -1 on failure.  */
+extern int i386_remove_watchpoint (CORE_ADDR addr, int len, int type);
+
+/* Return non-zero if we can watch a memory region that starts at
+   address ADDR and whose length is LEN bytes.  */
+extern int i386_region_ok_for_watchpoint (CORE_ADDR addr, int len);
+
+/* Return non-zero if the inferior has some break/watchpoint that
+   triggered.  */
+extern int i386_stopped_by_hwbp (void);
+
+/* If the inferior has some break/watchpoint that triggered, set
+   the address associated with that break/watchpoint and return
+   true.  Otherwise, return false.  */
+extern int i386_stopped_data_address (struct target_ops *, CORE_ADDR *);
+
+/* Insert a hardware-assisted breakpoint at BP_TGT->placed_address.
+   Return 0 on success, EBUSY on failure.  */
+struct bp_target_info;
+extern int i386_insert_hw_breakpoint (struct bp_target_info *bp_tgt);
+
+/* Remove a hardware-assisted breakpoint at BP_TGT->placed_address.
+   Return 0 on success, -1 on failure.  */
+extern int i386_remove_hw_breakpoint (struct bp_target_info *bp_tgt);
+
+extern int i386_stopped_by_watchpoint (void);
+
+/* Support for hardware watchpoints and breakpoints using the i386
+   debug registers.
+
+   This provides several functions for inserting and removing
+   hardware-assisted breakpoints and watchpoints, testing if one or
+   more of the watchpoints triggered and at what address, checking
+   whether a given region can be watched, etc.
+
+   A target which wants to use these functions should define
+   I386_USE_GENERIC_WATCHPOINTS in its tm.h file.
+
+   In addition, each target should provide several low-level functions
+   regrouped into i386_dr_low_type struct below. These functions
+   that will be called to insert watchpoints and hardware breakpoints
+   into the inferior, remove them, and check their status.  These
+   functions are:
+
+      set_control              -- set the debug control (DR7)
+				  register to a given value
+
+      set_addr                 -- put an address into one debug
+				  register
+
+      reset_addr               -- reset the address stored in
+				  one debug register
+
+      get_status               -- return the value of the debug
+				  status (DR6) register.
+
+   Additionally, the native file should set the debug_register_length
+   field to 4 or 8 depending on the number of bytes used for
+   deubg registers.  */
+
+struct i386_dr_low_type 
+  {
+    void (*set_control) (unsigned);
+    void (*set_addr) (int, CORE_ADDR);
+    void (*reset_addr) (int);
+    unsigned (*get_status) (void);
+    int debug_register_length;
+  };
+
+struct i386_dr_low_type i386_dr_low;
+
+/* Use this function to set i386_dr_low debug_register_length field
+   rather than setting it directly to check that the length is only
+   set once.  */
+
+extern void i386_set_debug_register_length (int len);
+
+#endif /* I386_USE_GENERIC_WATCHPOINTS */
+
+#endif /* I386_DR_NAT_H */
Index: src/gdb/amd64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-linux-nat.c,v
retrieving revision 1.25
diff -u -p -r1.25 amd64-linux-nat.c
--- src/gdb/amd64-linux-nat.c	17 Mar 2009 18:39:08 -0000	1.25
+++ src/gdb/amd64-linux-nat.c	8 May 2009 13:13:51 -0000
@@ -50,6 +50,7 @@
 #include "amd64-tdep.h"
 #include "i386-linux-tdep.h"
 #include "amd64-nat.h"
+#include "i386-nat.h"
 
 /* Mapping between the general-purpose registers in GNU/Linux x86-64
    `struct user' format and GDB's register cache layout.  */
@@ -667,6 +668,12 @@ _initialize_amd64_linux_nat (void)
 
   i386_use_watchpoints (t);
 
+  i386_dr_low.set_control = amd64_linux_dr_set_control;
+  i386_dr_low.set_addr = amd64_linux_dr_set_addr;
+  i386_dr_low.reset_addr = amd64_linux_dr_reset_addr;
+  i386_dr_low.get_status = amd64_linux_dr_get_status;
+  i386_set_debug_register_length (8);
+
   /* Override the GNU/Linux inferior startup hook.  */
   super_post_startup_inferior = t->to_post_startup_inferior;
   t->to_post_startup_inferior = amd64_linux_child_post_startup_inferior;
Index: src/gdb/amd64-windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-windows-nat.c,v
retrieving revision 1.3
diff -u -p -r1.3 amd64-windows-nat.c
--- src/gdb/amd64-windows-nat.c	13 Jan 2009 04:14:07 -0000	1.3
+++ src/gdb/amd64-windows-nat.c	8 May 2009 13:13:51 -0000
@@ -17,7 +17,7 @@
 
 #include "defs.h"
 #include "windows-nat.h"
-
+#include "i386-nat.h"
 #include <windows.h>
 
 #define context_offset(x) (offsetof (CONTEXT, x))
@@ -89,4 +89,5 @@ void
 _initialize_amd64_windows_nat (void)
 {
   windows_set_context_register_offsets (mappings);
+  i386_set_debug_register_length (8);
 }
Index: src/gdb/go32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/go32-nat.c,v
retrieving revision 1.74
diff -u -p -r1.74 go32-nat.c
--- src/gdb/go32-nat.c	4 May 2009 09:54:17 -0000	1.74
+++ src/gdb/go32-nat.c	8 May 2009 13:13:52 -0000
@@ -85,6 +85,7 @@
 #include <fcntl.h>
 
 #include "defs.h"
+#include "i386-nat.h"
 #include "inferior.h"
 #include "gdbthread.h"
 #include "gdb_wait.h"
@@ -975,6 +976,13 @@ init_go32_ops (void)
 
   i386_use_watchpoints (&go32_ops);
 
+
+  i386_dr_low.set_control = go32_set_dr7;
+  i386_dr_low.set_addr = go32_set_dr;
+  i386_dr_low.reset_addr = NULL;
+  i386_dr_low.get_status = go32_get_dr6;
+  i386_set_debug_register_length (4);
+
   go32_ops.to_magic = OPS_MAGIC;
 
   /* Initialize child's cwd as empty to be initialized when starting
Index: src/gdb/i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.90
diff -u -p -r1.90 i386-linux-nat.c
--- src/gdb/i386-linux-nat.c	23 Feb 2009 00:42:06 -0000	1.90
+++ src/gdb/i386-linux-nat.c	8 May 2009 13:13:53 -0000
@@ -19,6 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
 
 #include "defs.h"
+#include "i386-nat.h"
 #include "inferior.h"
 #include "gdbcore.h"
 #include "regcache.h"
@@ -825,6 +826,12 @@ _initialize_i386_linux_nat (void)
 
   i386_use_watchpoints (t);
 
+  i386_dr_low.set_control = i386_linux_dr_set_control;
+  i386_dr_low.set_addr = i386_linux_dr_set_addr;
+  i386_dr_low.reset_addr = i386_linux_dr_reset_addr;
+  i386_dr_low.get_status = i386_linux_dr_get_status;
+  i386_set_debug_register_length (4);
+
   /* Override the default ptrace resume method.  */
   t->to_resume = i386_linux_resume;
 
Index: src/gdb/i386-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nat.c,v
retrieving revision 1.20
diff -u -p -r1.20 i386-nat.c
--- src/gdb/i386-nat.c	29 Apr 2009 22:25:17 -0000	1.20
+++ src/gdb/i386-nat.c	8 May 2009 13:13:53 -0000
@@ -18,11 +18,13 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
 
+#include "i386-nat.h"
 #include "defs.h"
 #include "breakpoint.h"
 #include "command.h"
 #include "gdbcmd.h"
 #include "target.h"
+#include "gdb_assert.h"
 
 /* Support for hardware watchpoints and breakpoints using the i386
    debug registers.
@@ -32,29 +34,6 @@
    more of the watchpoints triggered and at what address, checking
    whether a given region can be watched, etc.
 
-   A target which wants to use these functions should define several
-   macros, such as `target_insert_watchpoint' and
-   `target_stopped_data_address', listed in target.h, to call the
-   appropriate functions below.  It should also define
-   I386_USE_GENERIC_WATCHPOINTS in its tm.h file.
-
-   In addition, each target should provide several low-level macros
-   that will be called to insert watchpoints and hardware breakpoints
-   into the inferior, remove them, and check their status.  These
-   macros are:
-
-      I386_DR_LOW_SET_CONTROL  -- set the debug control (DR7)
-				  register to a given value
-
-      I386_DR_LOW_SET_ADDR     -- put an address into one debug
-				  register
-
-      I386_DR_LOW_RESET_ADDR   -- reset the address stored in
-				  one debug register
-
-      I386_DR_LOW_GET_STATUS   -- return the value of the debug
-				  status (DR6) register.
-
    The functions below implement debug registers sharing by reference
    counts, and allow to watch regions up to 16 bytes long.  */
 
@@ -62,7 +41,7 @@
 
 /* Support for 8-byte wide hw watchpoints.  */
 #ifndef TARGET_HAS_DR_LEN_8
-#define TARGET_HAS_DR_LEN_8	0
+#define TARGET_HAS_DR_LEN_8 (i386_dr_low.debug_register_length == 8)
 #endif
 
 /* Debug registers' indices.  */
@@ -330,6 +309,9 @@ i386_insert_aligned_watchpoint (CORE_ADD
 {
   int i;
 
+  if (!i386_dr_low.set_addr || !i386_dr_low.set_control)
+    return -1;
+
   /* First, look for an occupied debug register with the same address
      and the same RW and LEN definitions.  If we find one, we can
      reuse it for this watchpoint as well (and save a register).  */
@@ -373,8 +355,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_ADDR (i, addr);
-  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;
 }
@@ -402,8 +384,9 @@ i386_remove_aligned_watchpoint (CORE_ADD
 	      dr_mirror[i] = 0;
 	      I386_DR_DISABLE (i);
 	      /* Reset it in the inferior.  */
-	      I386_DR_LOW_SET_CONTROL (dr_control_mirror);
-	      I386_DR_LOW_RESET_ADDR (i);
+	      i386_dr_low.set_control (dr_control_mirror);
+	      if (i386_dr_low.reset_addr)
+		i386_dr_low.reset_addr (i);
 	    }
 	  retval = 0;
 	}
@@ -562,7 +545,7 @@ i386_stopped_data_address (struct target
   int i;
   int rc = 0;
 
-  dr_status_mirror = I386_DR_LOW_GET_STATUS ();
+  dr_status_mirror = i386_dr_low.get_status ();
 
   ALL_DEBUG_REGISTERS(i)
     {
@@ -603,7 +586,7 @@ i386_stopped_by_hwbp (void)
 {
   int i;
 
-  dr_status_mirror = I386_DR_LOW_GET_STATUS ();
+  dr_status_mirror = i386_dr_low.get_status ();
   if (maint_show_dr)
     i386_show_dr ("stopped_by_hwbp", 0, 0, hw_execute);
 
@@ -688,6 +671,14 @@ i386_use_watchpoints (struct target_ops 
   t->to_remove_hw_breakpoint = i386_remove_hw_breakpoint;
 }
 
+void
+i386_set_debug_register_length (int len)
+{
+  /* This function should be called only once for each native target.  */
+  gdb_assert (i386_dr_low.debug_register_length == 0);
+  i386_dr_low.debug_register_length = len;
+}
+
 #endif /* I386_USE_GENERIC_WATCHPOINTS */
 

 
Index: src/gdb/i386-windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-windows-nat.c,v
retrieving revision 1.3
diff -u -p -r1.3 i386-windows-nat.c
--- src/gdb/i386-windows-nat.c	13 Jan 2009 04:14:07 -0000	1.3
+++ src/gdb/i386-windows-nat.c	8 May 2009 13:13:53 -0000
@@ -17,6 +17,7 @@
 
 #include "defs.h"
 #include "windows-nat.h"
+#include "i386-nat.h"
 
 #include <windows.h>
 
@@ -73,4 +74,5 @@ void
 _initialize_i386_windows_nat (void)
 {
   windows_set_context_register_offsets (mappings);
+  i386_set_debug_register_length (4);
 }
Index: src/gdb/i386fbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386fbsd-nat.c,v
retrieving revision 1.18
diff -u -p -r1.18 i386fbsd-nat.c
--- src/gdb/i386fbsd-nat.c	23 Feb 2009 00:03:49 -0000	1.18
+++ src/gdb/i386fbsd-nat.c	8 May 2009 13:13:53 -0000
@@ -29,6 +29,7 @@
 
 #include "fbsd-nat.h"
 #include "i386-tdep.h"
+#include "i386-nat.h"
 #include "i386bsd-nat.h"
 
 /* Resume execution of the inferior process.  If STEP is nonzero,
@@ -126,7 +127,19 @@ _initialize_i386fbsd_nat (void)
 
   /* Add some extra features to the common *BSD/i386 target.  */
   t = i386bsd_target ();
+
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+
   i386_use_watchpoints (t);
+
+  i386_dr_low.set_control = i386bsd_dr_set_control;
+  i386_dr_low.set_addr = i386bsd_dr_set_addr;
+  i386_dr_low.reset_addr = i386bsd_dr_reset_addr;
+  i386_dr_low.get_status = i386bsd_dr_get_status;
+  i386_set_debug_register_length (4);
+#endif /* I386_USE_GENERIC_WATCHPOINTS */
+
+
   t->to_resume = i386fbsd_resume;
   t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
   t->to_find_memory_regions = fbsd_find_memory_regions;
Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.189
diff -u -p -r1.189 windows-nat.c
--- windows-nat.c	17 Apr 2009 15:44:28 -0000	1.189
+++ windows-nat.c	8 May 2009 14:02:25 -0000
@@ -63,6 +63,7 @@
 
 #include "windows-tdep.h"
 #include "windows-nat.h"
+#include "i386-nat.h"
 
 #define AdjustTokenPrivileges		dyn_AdjustTokenPrivileges
 #define DebugActiveProcessStop		dyn_DebugActiveProcessStop
@@ -140,6 +141,10 @@ static void windows_stop (ptid_t);
 static int windows_thread_alive (struct target_ops *, ptid_t);
 static void windows_kill_inferior (struct target_ops *);
 
+void cygwin_set_dr (int i, CORE_ADDR addr);
+void cygwin_set_dr7 (unsigned val);
+unsigned cygwin_get_dr6 (void);
+
 static enum target_signal last_sig = TARGET_SIGNAL_0;
 /* Set if a signal was received from the debugged process */
 
@@ -2166,8 +2171,22 @@ init_windows_ops (void)
   windows_ops.to_has_execution = 1;
   windows_ops.to_pid_to_exec_file = windows_pid_to_exec_file;
   windows_ops.to_get_ada_task_ptid = windows_get_ada_task_ptid;
+
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+
   i386_use_watchpoints (&windows_ops);
 
+  i386_dr_low.set_control = cygwin_set_dr7;
+  i386_dr_low.set_addr = cygwin_set_dr;
+  i386_dr_low.reset_addr = NULL;
+  i386_dr_low.get_status = cygwin_get_dr6;
+
+  /* i386_dr_low.debug_register_length field is set by
+     calling i386_set_debug_register_length function
+     in processor windows specific native file.  */
+
+#endif /* I386_USE_GENERIC_WATCHPOINTS */
+
   windows_ops.to_magic = OPS_MAGIC;
 }
 
@@ -2260,6 +2279,8 @@ Show whether to display kernel exception
   deprecated_init_ui_hook = set_windows_aliases;
 }
 
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+
 /* Hardware watchpoint support, adapted from go32-nat.c code.  */
 
 /* Pass the address ADDR to the inferior in the I'th debug register.
@@ -2296,6 +2317,8 @@ cygwin_get_dr6 (void)
   return dr[6];
 }
 
+#endif /* I386_USE_GENERIC_WATCHPOINTS */
+
 /* Determine if the thread referenced by "ptid" is alive
    by "polling" it.  If WaitForSingleObject returns WAIT_OBJECT_0
    it means that the thread has died.  Otherwise it is assumed to be alive.
*/
Index: src/gdb/config/i386/nm-cygwin.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-cygwin.h,v
retrieving revision 1.10
diff -u -p -r1.10 nm-cygwin.h
--- src/gdb/config/i386/nm-cygwin.h	26 Mar 2009 00:18:46 -0000	1.10
+++ src/gdb/config/i386/nm-cygwin.h	8 May 2009 13:13:54 -0000
@@ -22,16 +22,3 @@ void dll_symbol_command (char *, int);
 #define I386_USE_GENERIC_WATCHPOINTS
 
 #include "i386/nm-i386.h"
-
-/* Support for hardware-assisted breakpoints and watchpoints.  */
-
-#define I386_DR_LOW_SET_CONTROL(VAL)	cygwin_set_dr7 (VAL)
-extern void cygwin_set_dr7 (unsigned);
-
-#define I386_DR_LOW_SET_ADDR(N,ADDR)	cygwin_set_dr (N,ADDR)
-extern void cygwin_set_dr (int, CORE_ADDR);
-
-#define I386_DR_LOW_RESET_ADDR(N)
-
-#define I386_DR_LOW_GET_STATUS()	cygwin_get_dr6 ()
-extern unsigned cygwin_get_dr6 (void);
Index: src/gdb/config/i386/nm-cygwin64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-cygwin64.h,v
retrieving revision 1.3
diff -u -p -r1.3 nm-cygwin64.h
--- src/gdb/config/i386/nm-cygwin64.h	26 Mar 2009 00:18:46 -0000	1.3
+++ src/gdb/config/i386/nm-cygwin64.h	8 May 2009 13:13:54 -0000
@@ -21,16 +21,3 @@ void dll_symbol_command (char *, int);
 #define I386_USE_GENERIC_WATCHPOINTS
 
 #include "i386/nm-i386.h"
-
-/* Support for hardware-assisted breakpoints and watchpoints.  */
-
-#define I386_DR_LOW_SET_CONTROL(VAL)	cygwin_set_dr7 (VAL)
-extern void cygwin_set_dr7 (unsigned);
-
-#define I386_DR_LOW_SET_ADDR(N,ADDR)	cygwin_set_dr (N,ADDR)
-extern void cygwin_set_dr (int, CORE_ADDR);
-
-#define I386_DR_LOW_RESET_ADDR(N)
-
-#define I386_DR_LOW_GET_STATUS()	cygwin_get_dr6 ()
-extern unsigned cygwin_get_dr6 (void);
Index: src/gdb/config/i386/nm-fbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-fbsd.h,v
retrieving revision 1.20
diff -u -p -r1.20 nm-fbsd.h
--- src/gdb/config/i386/nm-fbsd.h	26 Mar 2009 00:18:46 -0000	1.20
+++ src/gdb/config/i386/nm-fbsd.h	8 May 2009 13:13:54 -0000
@@ -31,23 +31,4 @@
 #include <sys/param.h>
 #endif
 
-/* Provide access to the i386 hardware debugging registers.  */
-
-#define I386_DR_LOW_SET_CONTROL(control) \
-  i386bsd_dr_set_control (control)
-extern void i386bsd_dr_set_control (unsigned long control);
-
-#define I386_DR_LOW_SET_ADDR(regnum, addr) \
-  i386bsd_dr_set_addr (regnum, addr)
-extern void i386bsd_dr_set_addr (int regnum, CORE_ADDR addr);
-
-#define I386_DR_LOW_RESET_ADDR(regnum) \
-  i386bsd_dr_reset_addr (regnum)
-extern void i386bsd_dr_reset_addr (int regnum);
-
-#define I386_DR_LOW_GET_STATUS() \
-  i386bsd_dr_get_status ()
-extern unsigned long i386bsd_dr_get_status (void);
-

-
 #endif /* nm-fbsd.h */
Index: src/gdb/config/i386/nm-go32.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-go32.h,v
retrieving revision 1.10
diff -u -p -r1.10 nm-go32.h
--- src/gdb/config/i386/nm-go32.h	26 Mar 2009 00:18:46 -0000	1.10
+++ src/gdb/config/i386/nm-go32.h	8 May 2009 13:13:54 -0000
@@ -20,16 +20,3 @@
 #define I386_USE_GENERIC_WATCHPOINTS
 
 #include "i386/nm-i386.h"
-
-/* Support for hardware-assisted breakpoints and watchpoints.  */
-
-#define I386_DR_LOW_SET_CONTROL(VAL)	go32_set_dr7 (VAL)
-extern void go32_set_dr7 (unsigned);
-
-#define I386_DR_LOW_SET_ADDR(N,ADDR)	go32_set_dr (N,ADDR)
-extern void go32_set_dr (int, CORE_ADDR);
-
-#define I386_DR_LOW_RESET_ADDR(N)
-
-#define I386_DR_LOW_GET_STATUS()	go32_get_dr6 ()
-extern unsigned go32_get_dr6 (void);
Index: src/gdb/config/i386/nm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-linux.h,v
retrieving revision 1.30
diff -u -p -r1.30 nm-linux.h
--- src/gdb/config/i386/nm-linux.h	26 Mar 2009 00:18:46 -0000	1.30
+++ src/gdb/config/i386/nm-linux.h	8 May 2009 13:13:54 -0000
@@ -28,25 +28,6 @@
 #include "i386/nm-i386.h"
 #include "config/nm-linux.h"
 
-/* Provide access to the i386 hardware debugging registers.  */
-
-extern void i386_linux_dr_set_control (unsigned long control);
-#define I386_DR_LOW_SET_CONTROL(control) \
-  i386_linux_dr_set_control (control)
-
-extern void i386_linux_dr_set_addr (int regnum, CORE_ADDR addr);
-#define I386_DR_LOW_SET_ADDR(regnum, addr) \
-  i386_linux_dr_set_addr (regnum, addr)
-
-extern void i386_linux_dr_reset_addr (int regnum);
-#define I386_DR_LOW_RESET_ADDR(regnum) \
-  i386_linux_dr_reset_addr (regnum)
-
-extern unsigned long i386_linux_dr_get_status (void);
-#define I386_DR_LOW_GET_STATUS() \
-  i386_linux_dr_get_status ()
-

-
 #ifdef HAVE_PTRACE_GETFPXREGS
 /* Include register set support for the SSE registers.  */
 #define FILL_FPXREGSET
Index: src/gdb/config/i386/nm-linux64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-linux64.h,v
retrieving revision 1.10
diff -u -p -r1.10 nm-linux64.h
--- src/gdb/config/i386/nm-linux64.h	26 Mar 2009 00:18:46 -0000	1.10
+++ src/gdb/config/i386/nm-linux64.h	8 May 2009 13:13:54 -0000
@@ -29,25 +29,4 @@
 #include "i386/nm-i386.h"
 #include "config/nm-linux.h"
 
-/* Support for 8-byte wide hardware watchpoints.  */
-#define TARGET_HAS_DR_LEN_8 1
-
-/* Provide access to the i386 hardware debugging registers.  */
-
-extern void amd64_linux_dr_set_control (unsigned long control);
-#define I386_DR_LOW_SET_CONTROL(control) \
-  amd64_linux_dr_set_control (control)
-
-extern void amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
-#define I386_DR_LOW_SET_ADDR(regnum, addr) \
-  amd64_linux_dr_set_addr (regnum, addr)
-
-extern void amd64_linux_dr_reset_addr (int regnum);
-#define I386_DR_LOW_RESET_ADDR(regnum) \
-  amd64_linux_dr_reset_addr (regnum)
-
-extern unsigned long amd64_linux_dr_get_status (void);
-#define I386_DR_LOW_GET_STATUS() \
-  amd64_linux_dr_get_status ()
-
 #endif /* nm-linux64.h */




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