gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
gdbarch_addr_bits_remove_ftype *addr_bits_remove;
gdbarch_software_single_step_ftype *software_single_step;
+ gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
};
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
gdbarch->extra_stack_alignment_needed = 1;
gdbarch->convert_from_func_ptr_addr = core_addr_identity;
gdbarch->addr_bits_remove = core_addr_identity;
+ gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
/* gdbarch_alloc() */
return gdbarch;
/* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
/* Skip verify of addr_bits_remove, invalid_p == 0 */
/* Skip verify of software_single_step, has predicate */
+ /* Skip verify of skip_trampoline_code, invalid_p == 0 */
}
"SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
#endif
+#ifdef SKIP_TRAMPOLINE_CODE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SKIP_TRAMPOLINE_CODE(pc)",
+ XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
+#endif
#ifdef TARGET_ARCHITECTURE
if (TARGET_ARCHITECTURE != NULL)
fprintf_unfiltered (file,
"gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
(long) current_gdbarch->software_single_step
/*SOFTWARE_SINGLE_STEP ()*/);
+#endif
+#ifdef SKIP_TRAMPOLINE_CODE
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n",
+ (long) current_gdbarch->skip_trampoline_code
+ /*SKIP_TRAMPOLINE_CODE ()*/);
#endif
if (current_gdbarch->dump_tdep != NULL)
current_gdbarch->dump_tdep (current_gdbarch, file);
gdbarch->software_single_step = software_single_step;
}
+CORE_ADDR
+gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ if (gdbarch->skip_trampoline_code == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_skip_trampoline_code invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
+ return gdbarch->skip_trampoline_code (pc);
+}
+
+void
+set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
+ gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
+{
+ gdbarch->skip_trampoline_code = skip_trampoline_code;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
+#define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
+#endif
+
+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 (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
+#error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE)
+#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
+#endif
+#endif
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
#endif
-/* Some machines have trampoline code that sits between function callers
- and the actual functions themselves. If this machine doesn't have
- such things, disable their processing. */
-
-#ifndef SKIP_TRAMPOLINE_CODE
-#define SKIP_TRAMPOLINE_CODE(pc) 0
-#endif
-
/* Dynamic function trampolines are similar to solib trampolines in that they
are between the caller and the callee. The difference is that when you
enter a dynamic trampoline, you can't determine the callee's address. Some