* gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Add.
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.c, arch-utils.h (generic_in_solib_return_trampoline):
Add.
* infrun.c (IN_SOLIB_RETURN_TRAMPOLINE): Delete default definition.
+2002-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Add.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * arch-utils.c, arch-utils.h (generic_in_solib_return_trampoline):
+ Add.
+ * infrun.c (IN_SOLIB_RETURN_TRAMPOLINE): Delete default definition.
+
2002-08-20 Michael Snyder <msnyder@redhat.com>
* mips-tdep.c (mips_skip_stub, mips_in_call_stub): Make static.
return 0;
}
+int
+generic_in_solib_return_trampoline (CORE_ADDR pc, char *name)
+{
+ return 0;
+}
+
int
generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name);
+extern int generic_in_solib_return_trampoline (CORE_ADDR pc, char *name);
+
extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
/* Assume that the world is sane, a registers raw and virtual size
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
+ gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
0,
0,
0,
+ 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
+ current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
+ /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
/* Skip verify of pc_in_sigtramp, invalid_p == 0 */
/* Skip verify of in_function_epilogue_p, invalid_p == 0 */
/* Skip verify of construct_inferior_arguments, invalid_p == 0 */
(long) current_gdbarch->in_solib_call_trampoline
/*IN_SOLIB_CALL_TRAMPOLINE ()*/);
#endif
+#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)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = 0x%08lx\n",
+ (long) current_gdbarch->in_solib_return_trampoline
+ /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
+#endif
#ifdef MAX_REGISTER_RAW_SIZE
fprintf_unfiltered (file,
"gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
}
+int
+gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->in_solib_return_trampoline == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_in_solib_return_trampoline invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
+ return gdbarch->in_solib_return_trampoline (pc, name);
+}
+
+void
+set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
+ gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
+{
+ gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
+}
+
int
gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
{
/* For SVR4 shared libraries, each call goes through a small piece of
trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
- to nonzero if we are current stopped in one of these. */
+ to nonzero if we are currently stopped in one of these. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
#endif
#endif
+/* Some systems also have trampoline code for returning from shared libs. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE)
+#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name))
+#endif
+
+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 (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE)
+#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE)
+#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
+#endif
+#endif
+
/* Sigtramp is a routine that the kernel calls (which then calls the
signal handler). On most machines it is a library routine that is
linked into the executable.
F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0
f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
+
+
# For SVR4 shared libraries, each call goes through a small piece of
# trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
-# to nonzero if we are current stopped in one of these.
+# to nonzero if we are currently stopped in one of these.
f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
+
+# Some systems also have trampoline code for returning from shared libs.
+f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_return_trampoline::0
+
# Sigtramp is a routine that the kernel calls (which then calls the
# signal handler). On most machines it is a library routine that is
# linked into the executable.
#define SKIP_SOLIB_RESOLVER(pc) 0
#endif
-/* In some shared library schemes, the return path from a shared library
- call may need to go through a trampoline too. */
-
-#ifndef IN_SOLIB_RETURN_TRAMPOLINE
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc,name) 0
-#endif
-
/* This function returns TRUE if pc is the address of an instruction
that lies within the dynamic linker (such as the event hook, or the
dld itself).