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] [8/9] Remove macros CANNOT_SET_BREAKPOINT and HAVE_NONSTEPPABLE_WATCHPOINT


Hello,

this patch removes CANNOT_SET_BREAKPOINT and HAVE_NONSTEPPABLE_WATCHPOINT macros from gdbarch.sh

ChangeLog:

	* gdbarch.sh (HAVE_NONSTEPPABLE_WATCHPOINT): Replace by
	gdbarch_have_nonsteppable_watchpoint.
	* infrun.c (handle_inferior_event,adjust_pc_after_break): Likewiseo.
	* gdbarch.sh (CANNOT_STEP_BREAKPOINT): Replace by
	gdbarch_cannot_step_breakpoint.
	* infrun.c (resume): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.



Is this ok to commit?

Regards,
Markus


--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com









diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src/gdb/gdbarch.c	2007-05-14 17:16:57.000000000 +0200
+++ dev/gdb/gdbarch.c	2007-05-22 05:45:43.000000000 +0200
@@ -776,11 +776,6 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
                       (long) current_gdbarch->cannot_fetch_register);
-#ifdef CANNOT_STEP_BREAKPOINT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
-                      XSTRING (CANNOT_STEP_BREAKPOINT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: cannot_step_breakpoint = %s\n",
                       paddr_d (current_gdbarch->cannot_step_breakpoint));
@@ -1099,11 +1094,6 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
                       (long) current_gdbarch->get_longjmp_target);
-#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
-                      XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
                       paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h	2007-05-14 17:16:57.000000000 +0200
+++ dev/gdb/gdbarch.h	2007-05-22 05:45:33.000000000 +0200
@@ -1203,21 +1203,9 @@
 
 extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
 extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
-#if !defined (GDB_TM_FILE) && defined (CANNOT_STEP_BREAKPOINT)
-#error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
-#endif
-#if !defined (CANNOT_STEP_BREAKPOINT)
-#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
-#endif
 
 extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
 extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
-#if !defined (GDB_TM_FILE) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
-#error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
-#endif
-#if !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
-#define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
-#endif
 
 #if defined (ADDRESS_CLASS_TYPE_FLAGS)
 /* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh	2007-05-14 17:16:57.000000000 +0200
+++ dev/gdb/gdbarch.sh	2007-05-22 05:45:21.000000000 +0200
@@ -653,8 +653,8 @@
 f:=:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym::default_elf_make_msymbol_special::0
 f:=:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym::default_coff_make_msymbol_special::0
 v:=:const char *:name_of_malloc:::"malloc":"malloc"::0:NAME_OF_MALLOC
-v:=:int:cannot_step_breakpoint:::0:0::0
-v:=:int:have_nonsteppable_watchpoint:::0:0::0
+v::int:cannot_step_breakpoint:::0:0::0
+v::int:have_nonsteppable_watchpoint:::0:0::0
 F:=:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
 M::const char *:address_class_type_flags_to_name:int type_flags:type_flags
 M::int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr
diff -urN src/gdb/infrun.c dev/gdb/infrun.c
--- src/gdb/infrun.c	2007-05-07 20:20:18.000000000 +0200
+++ dev/gdb/infrun.c	2007-05-22 05:51:15.000000000 +0200
@@ -600,7 +600,7 @@
 	  resume_ptid = inferior_ptid;
 	}
 
-      if (CANNOT_STEP_BREAKPOINT)
+      if (gdbarch_cannot_step_breakpoint (current_gdbarch))
 	{
 	  /* Most targets can step a breakpoint instruction, thus
 	     executing it normally.  But if this one cannot, just
@@ -1166,11 +1166,11 @@
      these signals at breakpoints (the code has been in GDB since at least
      1992) so I can not guess how to handle them here.
 
-     In earlier versions of GDB, a target with HAVE_NONSTEPPABLE_WATCHPOINTS
-     would have the PC after hitting a watchpoint affected by
-     DECR_PC_AFTER_BREAK.  I haven't found any target with both of these set
-     in GDB history, and it seems unlikely to be correct, so
-     HAVE_NONSTEPPABLE_WATCHPOINTS is not checked here.  */
+     In earlier versions of GDB, a target with 
+     gdbarch_have_nonsteppable_watchpoint would have the PC after hitting a
+     watchpoint affected by DECR_PC_AFTER_BREAK.  I haven't found any target
+     with both of these set in GDB history, and it seems unlikely to be correct,
+     so gdbarch_have_nonsteppable_watchpoint is not checked here.  */
 
   if (ecs->ws.kind != TARGET_WAITKIND_STOPPED)
     return;
@@ -1761,7 +1761,8 @@
   /* It is far more common to need to disable a watchpoint to step
      the inferior over it.  FIXME.  What else might a debug
      register or page protection watchpoint scheme need here?  */
-  if (HAVE_NONSTEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
+  if (gdbarch_have_nonsteppable_watchpoint (current_gdbarch)
+      && STOPPED_BY_WATCHPOINT (ecs->ws))
     {
       /* At this point, we are stopped at an instruction which has
          attempted to write to a piece of memory under control of



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