aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJiri Smid <smid@suse.cz>2001-12-07 12:10:15 +0000
committerJiri Smid <smid@suse.cz>2001-12-07 12:10:15 +0000
commitb6af0555b58f4a5996fd3590f2cb40d3664136f7 (patch)
tree9b7a4ced0b51e81f780db2bf5cf41bc7ba9c281d /gdb/gdbarch.c
parent1fbc4a84a3764dd04760128c5666348c0fa070eb (diff)
downloadgdb-b6af0555b58f4a5996fd3590f2cb40d3664136f7.zip
gdb-b6af0555b58f4a5996fd3590f2cb40d3664136f7.tar.gz
gdb-b6af0555b58f4a5996fd3590f2cb40d3664136f7.tar.bz2
* dwarf2cfi.c: New file.
* dwarf2cfi.h: New file. * dwarf2read.c (dwarf_frame_offset, dwarf_frame_size): New variables. (dwarf_eh_frame_offset, dwarf_eh_frame_size): New variables. (dwarf2_read_section): Change to non static. (dwarf2_locate_sections): Add .debug_frame and .eh_frame section recognition. (FRAME_SECTION, EH_FRAME_SECTION): New define. * elfread.c (elf_symfile_read): Add call of frame informations build. * frame.h (frame_info): Add pointer to unwind_context. * symfile.h (dwarf2_build_frame_info): Add declaration. * gdbarch.sh (DWARF2_BUILD_FRAME_INFO): Add. * gdbarch.h, gdbarch.c: Regenerate. * Makefile.in: Add dwarf2cfi_h, dwarf2cfi.o * x86-64-tdep.c (i386_gdbarch_init): Initialize target vector to use debug frame info.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 83895a4..ffd1ac5 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -256,6 +256,7 @@ struct gdbarch
gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
+ gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
};
@@ -396,6 +397,7 @@ struct gdbarch startup_gdbarch =
0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
+ 0,
/* startup_gdbarch() */
};
@@ -759,6 +761,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
/* Skip verify of in_function_epilogue_p, invalid_p == 0 */
/* Skip verify of construct_inferior_arguments, invalid_p == 0 */
+ /* Skip verify of dwarf2_build_frame_info, has predicate */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -1003,6 +1006,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->do_registers_info
/*DO_REGISTERS_INFO ()*/);
#endif
+#ifdef DWARF2_BUILD_FRAME_INFO
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DWARF2_BUILD_FRAME_INFO(objfile)",
+ XSTRING (DWARF2_BUILD_FRAME_INFO (objfile)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = 0x%08lx\n",
+ (long) current_gdbarch->dwarf2_build_frame_info
+ /*DWARF2_BUILD_FRAME_INFO ()*/);
+#endif
#ifdef DWARF2_REG_TO_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -4308,6 +4325,30 @@ set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
gdbarch->construct_inferior_arguments = construct_inferior_arguments;
}
+int
+gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->dwarf2_build_frame_info != 0;
+}
+
+void
+gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
+{
+ if (gdbarch->dwarf2_build_frame_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_dwarf2_build_frame_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n");
+ gdbarch->dwarf2_build_frame_info (objfile);
+}
+
+void
+set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
+ gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info)
+{
+ gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */