2003-06-12 Jim Blandy <jimb@redhat.com>
+ * gdbarch.sh (gdbarch_bfd_entry_point): New gdbarch method.
+ * arch-utils.c (generic_bfd_entry_point): New function.
+ * arch-utils.h (generic_bfd_entry_point): New declaration.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * solib-svr4.c (enable_break): Call it, instead of accessing
+ tmp_bfd->start_address directly.
+
* ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr): New
function.
(ppc_linux_init_abi): Register it as the
gdbarch_software_single_step_ftype *software_single_step;
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
+ gdbarch_bfd_entry_point_ftype *bfd_entry_point;
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;
0,
0,
0,
+ generic_bfd_entry_point,
0,
0,
0,
current_gdbarch->smash_text_address = core_addr_identity;
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
+ current_gdbarch->bfd_entry_point = generic_bfd_entry_point;
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;
/* Skip verify of software_single_step, has predicate */
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
+ /* Skip verify of bfd_entry_point, 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 */
fprintf_unfiltered (file,
"gdbarch_dump: GDB_MULTI_ARCH = %d\n",
GDB_MULTI_ARCH);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: bfd_entry_point = 0x%08lx\n",
+ (long) current_gdbarch->bfd_entry_point);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_frame_align_p() = %d\n",
gdbarch->skip_trampoline_code = skip_trampoline_code;
}
+CORE_ADDR
+gdbarch_bfd_entry_point (struct gdbarch *gdbarch, bfd *abfd)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->bfd_entry_point == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_bfd_entry_point invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_entry_point called\n");
+ return gdbarch->bfd_entry_point (gdbarch, abfd);
+}
+
+void
+set_gdbarch_bfd_entry_point (struct gdbarch *gdbarch,
+ gdbarch_bfd_entry_point_ftype bfd_entry_point)
+{
+ gdbarch->bfd_entry_point = bfd_entry_point;
+}
+
int
gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
{
#endif
#endif
+/* The actual code address at which ABFD would begin execution. Note
+ that on some architectures (like 64-bit PowerPC Linux),
+ bfd_get_start_address actually points to a function descriptor, not
+ the start function's entry point itself. */
+
+typedef CORE_ADDR (gdbarch_bfd_entry_point_ftype) (struct gdbarch *gdbarch, bfd *abfd);
+extern CORE_ADDR gdbarch_bfd_entry_point (struct gdbarch *gdbarch, bfd *abfd);
+extern void set_gdbarch_bfd_entry_point (struct gdbarch *gdbarch, gdbarch_bfd_entry_point_ftype *bfd_entry_point);
+
/* 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 currently stopped in one of these. */
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
+# The actual code address at which ABFD would begin execution. Note
+# that on some architectures (like 64-bit PowerPC Linux),
+# bfd_get_start_address actually points to a function descriptor, not
+# the start function's entry point itself.
+m:1::CORE_ADDR:bfd_entry_point:bfd *abfd:abfd:::generic_bfd_entry_point::0
# For SVR4 shared libraries, each call goes through a small piece of
# trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates