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]

[commit] move mips/tm-embed.h to target vector


(well almost)
This moves the macros found in mips/tm-embed.h to the remote-mips.c target vector. One macro left - HAVE_NONSTEPPABLE_WATCHPOINT - but that's a separate problem.


committed,
Andrew
2003-08-29  Andrew Cagney  <cagney@redhat.com>

	* config/mips/tm-embed.h (STOPPED_BY_WATCHPOINT): Delete macro.
	(TARGET_CAN_USE_HARDWARE_WATCHPOINT): Delete macro.
	(target_remove_watchpoint): Delete macro.
	(target_insert_watchpoint): Delete macro.
	(remote_mips_can_use_hardware_watchpoint): Delete declaration.
	(remote_mips_stopped_by_watchpoint): Delete declaration.
	(remote_mips_remove_watchpoint): Delete declaration.
	(remote_mips_set_watchpoint): Delete declaration.
	(TARGET_HAS_HARDWARE_WATCHPOINTS): Delete macro.
	* remote-mips.c (_initialize_remote_mips): Set
	"to_insert_watchpoint", "to_stopped_by_watchpoint",
	"to_can_use_hardware_watchpoint", and "to_remove_watchpoint".
	(mips_insert_watchpoint): Rename remote_mips_set_watchpoint.
	(mips_remove_watchpoint): Rename remote_mips_remove_watchpoint.
	(mips_stopped_by_watchpoint): Rename
	remote_mips_stopped_by_watchpoint.
	(mips_can_hardware_watchpoint): Rename
	remote_mips_can_use_hardware_watchpoint, update function
	signature.

Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.37
diff -u -r1.37 remote-mips.c
--- remote-mips.c	5 Aug 2003 02:44:50 -0000	1.37
+++ remote-mips.c	29 Aug 2003 16:13:04 -0000
@@ -2405,7 +2405,7 @@
    implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
 
 int
-remote_mips_can_use_hardware_watchpoint (int cnt)
+mips_can_use_watchpoint (int type, int cnt, int othertype)
 {
   return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
 }
@@ -2464,7 +2464,7 @@
    watchpoint. */
 
 int
-remote_mips_set_watchpoint (CORE_ADDR addr, int len, int type)
+mips_insert_watchpoint (CORE_ADDR addr, int len, int type)
 {
   if (set_breakpoint (addr, len, type))
     return -1;
@@ -2473,7 +2473,7 @@
 }
 
 int
-remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type)
+mips_remove_watchpoint (CORE_ADDR addr, int len, int type)
 {
   if (clear_breakpoint (addr, len, type))
     return -1;
@@ -2482,7 +2482,7 @@
 }
 
 int
-remote_mips_stopped_by_watchpoint (void)
+mips_stopped_by_watchpoint (void)
 {
   return hit_watchpoint;
 }
@@ -3494,6 +3494,10 @@
   mips_ops.to_files_info = mips_files_info;
   mips_ops.to_insert_breakpoint = mips_insert_breakpoint;
   mips_ops.to_remove_breakpoint = mips_remove_breakpoint;
+  mips_ops.to_insert_watchpoint = mips_insert_watchpoint;
+  mips_ops.to_remove_watchpoint = mips_remove_watchpoint;
+  mips_ops.to_stopped_by_watchpoint = mips_stopped_by_watchpoint;
+  mips_ops.to_can_use_hw_breakpoint = mips_can_use_watchpoint;
   mips_ops.to_kill = mips_kill;
   mips_ops.to_load = mips_load;
   mips_ops.to_create_inferior = mips_create_inferior;
Index: config/mips/tm-embed.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-embed.h,v
retrieving revision 1.7
diff -u -r1.7 tm-embed.h
--- config/mips/tm-embed.h	1 Jun 2003 14:45:28 -0000	1.7
+++ config/mips/tm-embed.h	29 Aug 2003 16:13:04 -0000
@@ -19,28 +19,13 @@
 
 #include "mips/tm-mips.h"
 
-/* Watchpoint support */
-
-#define TARGET_HAS_HARDWARE_WATCHPOINTS
-
-/* Use these macros for watchpoint insertion/deletion.  */
-/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
-
-#define target_insert_watchpoint(addr, len, type) \
-	remote_mips_set_watchpoint (addr, len, type)
-int remote_mips_set_watchpoint (CORE_ADDR addr, int len, int type);
-
-#define target_remove_watchpoint(addr, len, type) \
-	remote_mips_remove_watchpoint (addr, len, type)
-int remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type);
-
 /* We need to remove watchpoints when stepping, else we hit them again! */
 
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-
-int remote_mips_stopped_by_watchpoint (void);
-#define STOPPED_BY_WATCHPOINT(w) remote_mips_stopped_by_watchpoint ()
+/* FIXME: cagney/2003-08-29: The macros HAVE_STEPPABLE_WATCHPOINT,
+   HAVE_NONSTEPPABLE_WATCHPOINT, and HAVE_CONTINUABLE_WATCHPOINT need
+   to all be folded into the target vector.  Since they are being used
+   as guards for STOPPED_BY_WATCHPOINT, why not have
+   STOPPED_BY_WATCHPOINT return the type of watchpoint that the code
+   is sitting on?  */
 
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
-  remote_mips_can_use_hardware_watchpoint(cnt)
-int remote_mips_can_use_hardware_watchpoint (int cnt);
+#define HAVE_NONSTEPPABLE_WATCHPOINT 1

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