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/8] Remove macros SKIP_TRAMPOLINE_CODE and IN_SOLIB_RETURN_TRAMPOLINE


Hello,

this patch removes SKIP_TRAMPOLINE_CODE and IN_SOLIB_RETURN_TRAMPOLINE macro from gdbarch.sh

ChangeLog:

	* gdbarch.sh (SKIP_TRAMPOLINE_CODE): Replace by
	gdbarch_skip_trampoline_code.
	* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise (comment).
	* objc-lang.c (objc_skip_trampoline)
	(objc_submethod_helper_data): Likewise.
	* m32c-lang.c (m32c_skip_trampoline_code): Likewise (comment).
	* infrun.c (handle_inferior_event): Likewise.
	* gnu-v3-abi.c (gnuv3_skip_trampoline): Likewise.
	* gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Replace by
	gdbarch_in_solib_return_trampoline.
	* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise (comment).
	* infrun.c (handle_inferior_event): Likewise.
	* hppa-tdep.c (hppa_stub_unwind_sniffer): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.




Is this ok to commit?


--
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-06-08 05:38:50.000000000 +0200
+++ dev/gdb/gdbarch.c	2007-06-08 08:30:35.000000000 +0200
@@ -1006,12 +1006,6 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
                       (long) current_gdbarch->in_function_epilogue_p);
-#ifdef IN_SOLIB_RETURN_TRAMPOLINE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
-                      XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
                       (long) current_gdbarch->in_solib_return_trampoline);
@@ -1290,12 +1284,6 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
                       (long) current_gdbarch->skip_solib_resolver);
-#ifdef SKIP_TRAMPOLINE_CODE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "SKIP_TRAMPOLINE_CODE(pc)",
-                      XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
                       (long) current_gdbarch->skip_trampoline_code);
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h	2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/gdbarch.h	2007-06-08 08:30:35.000000000 +0200
@@ -978,12 +978,6 @@
 typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
 extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
 extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
-#if !defined (GDB_TM_FILE) && defined (SKIP_TRAMPOLINE_CODE)
-#error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
-#endif
-#if !defined (SKIP_TRAMPOLINE_CODE)
-#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
-#endif
 
 /* If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
    evaluates non-zero, this is the address where the debugger will place
@@ -998,12 +992,6 @@
 typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name);
 extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
 extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
-#if !defined (GDB_TM_FILE) && defined (IN_SOLIB_RETURN_TRAMPOLINE)
-#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE"
-#endif
-#if !defined (IN_SOLIB_RETURN_TRAMPOLINE)
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
-#endif
 
 /* A target might have problems with watchpoints as soon as the stack
    frame of the current function has been destroyed.  This mostly happens
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh	2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/gdbarch.sh	2007-06-08 08:30:35.000000000 +0200
@@ -621,7 +621,7 @@
 # FIXME: cagney/2003-08-28: Need to find a better way of selecting the
 # disassembler.  Perhaps objdump can handle it?
 f:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:vma, info::0:
-f:=:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc::generic_skip_trampoline_code::0
+f::CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc::generic_skip_trampoline_code::0
 
 
 # If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
@@ -629,7 +629,7 @@
 # a step-resume breakpoint to get us past the dynamic linker.
 m::CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc::generic_skip_solib_resolver::0
 # Some systems also have trampoline code for returning from shared libs.
-f:=:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_solib_return_trampoline::0
+f::int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_solib_return_trampoline::0
 
 # A target might have problems with watchpoints as soon as the stack
 # frame of the current function has been destroyed.  This mostly happens
diff -urN src/gdb/gnu-v3-abi.c dev/gdb/gnu-v3-abi.c
--- src/gdb/gnu-v3-abi.c	2007-05-07 13:49:04.000000000 +0200
+++ dev/gdb/gnu-v3-abi.c	2007-06-08 08:31:16.000000000 +0200
@@ -685,7 +685,7 @@
   struct obj_section *section;
   char *thunk_name, *fn_name;
   
-  real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+  real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc);
   if (real_stop_pc == 0)
     real_stop_pc = stop_pc;
 
@@ -708,7 +708,8 @@
     return 0;
 
   method_stop_pc = SYMBOL_VALUE_ADDRESS (fn_sym);
-  real_stop_pc = SKIP_TRAMPOLINE_CODE (method_stop_pc);
+  real_stop_pc = gdbarch_skip_trampoline_code
+		   (current_gdbarch, method_stop_pc);
   if (real_stop_pc == 0)
     real_stop_pc = method_stop_pc;
 
diff -urN src/gdb/hppa-tdep.c dev/gdb/hppa-tdep.c
--- src/gdb/hppa-tdep.c	2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/hppa-tdep.c	2007-06-08 08:30:35.000000000 +0200
@@ -2456,7 +2456,7 @@
   if (pc == 0
       || (tdep->in_solib_call_trampoline != NULL
 	  && tdep->in_solib_call_trampoline (pc, NULL))
-      || IN_SOLIB_RETURN_TRAMPOLINE (pc, NULL))
+      || gdbarch_in_solib_return_trampoline (current_gdbarch, pc, NULL))
     return &hppa_stub_frame_unwind;
   return NULL;
 }
diff -urN src/gdb/infrun.c dev/gdb/infrun.c
--- src/gdb/infrun.c	2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/infrun.c	2007-06-08 08:31:52.000000000 +0200
@@ -2457,7 +2457,7 @@
          end of, if we do step into it.  */
       real_stop_pc = skip_language_trampoline (stop_pc);
       if (real_stop_pc == 0)
-	real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+	real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc);
       if (real_stop_pc != 0)
 	ecs->stop_func_start = real_stop_pc;
 
@@ -2515,10 +2515,12 @@
 
   /* If we're in the return path from a shared library trampoline,
      we want to proceed through the trampoline when stepping.  */
-  if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+  if (gdbarch_in_solib_return_trampoline (current_gdbarch,
+					  stop_pc, ecs->stop_func_name))
     {
       /* Determine where this trampoline returns.  */
-      CORE_ADDR real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+      CORE_ADDR real_stop_pc = gdbarch_skip_trampoline_code
+				 (current_gdbarch, stop_pc);
 
       if (debug_infrun)
 	 fprintf_unfiltered (gdb_stdlog, "infrun: stepped into solib return tramp\n");
diff -urN src/gdb/m32c-tdep.c dev/gdb/m32c-tdep.c
--- src/gdb/m32c-tdep.c	2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/m32c-tdep.c	2007-06-08 08:30:35.000000000 +0200
@@ -2319,10 +2319,10 @@
    their program is calling, not in some trampoline code they've never
    seen before.)
 
-   The SKIP_TRAMPOLINE_CODE gdbarch method tells GDB how to step
+   The gdbarch_skip_trampoline_code method tells GDB how to step
    through such trampoline functions transparently to the user.  When
    given the address of a trampoline function's first instruction,
-   SKIP_TRAMPOLINE_CODE should return the address of the first
+   gdbarch_skip_trampoline_code should return the address of the first
    instruction of the function really being called.  If GDB decides it
    wants to step into that function, it will set a breakpoint there
    and silently continue to it.
diff -urN src/gdb/objc-lang.c dev/gdb/objc-lang.c
--- src/gdb/objc-lang.c	2007-06-08 05:38:51.000000000 +0200
+++ dev/gdb/objc-lang.c	2007-06-08 08:32:19.000000000 +0200
@@ -576,7 +576,7 @@
   CORE_ADDR real_stop_pc;
   CORE_ADDR method_stop_pc;
   
-  real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+  real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc);
 
   if (real_stop_pc != 0)
     find_objc_msgcall (real_stop_pc, &method_stop_pc);
@@ -585,7 +585,8 @@
 
   if (method_stop_pc)
     {
-      real_stop_pc = SKIP_TRAMPOLINE_CODE (method_stop_pc);
+      real_stop_pc = gdbarch_skip_trampoline_code
+		       (current_gdbarch, method_stop_pc);
       if (real_stop_pc == 0)
 	real_stop_pc = method_stop_pc;
     }
@@ -1647,7 +1648,7 @@
  * The old function "pc_off_limits" used to do a lot of other things
  * in addition, such as detecting shared library jump stubs and
  * returning the address of the shlib function that would be called.
- * That functionality has been moved into the SKIP_TRAMPOLINE_CODE and
+ * That functionality has been moved into the gdbarch_skip_trampoline_code and
  * IN_SOLIB_TRAMPOLINE macros, which are resolved in the target-
  * dependent modules.  
  */
diff -urN src/gdb/rs6000-tdep.c dev/gdb/rs6000-tdep.c
--- src/gdb/rs6000-tdep.c	2007-05-31 22:58:08.000000000 +0200
+++ dev/gdb/rs6000-tdep.c	2007-06-08 08:30:35.000000000 +0200
@@ -1946,8 +1946,8 @@
    branches, meaning that the link register doesn't get set.
    Therefore, GDB's usual step_over_function () mechanism won't work.
 
-   Instead, use the IN_SOLIB_RETURN_TRAMPOLINE and
-   SKIP_TRAMPOLINE_CODE hooks in handle_inferior_event() to skip past
+   Instead, use the gdbarch_skip_trampoline_code and
+   gdbarch_skip_trampoline_code hooks in handle_inferior_event() to skip past
    @FIX code.  */
 
 int



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