aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2009-06-16 21:06:40 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2009-06-16 21:06:40 +0000
commitdce234bc19cdb9db9663872e25ccb456facdfb4f (patch)
tree439823606840e2fdc077df6281bad3b02688f09e /gdb/dwarf2-frame.c
parent7eedccfa2afb7a44b513282cb138d85cde1f7f41 (diff)
downloadgdb-dce234bc19cdb9db9663872e25ccb456facdfb4f.zip
gdb-dce234bc19cdb9db9663872e25ccb456facdfb4f.tar.gz
gdb-dce234bc19cdb9db9663872e25ccb456facdfb4f.tar.bz2
2009-06-16 Paul Pluzhnikov <ppluzhnikov@google.com>
* dwarf2read.c (dwarf_info_section, dwarf_abbrev_section) (dwarf_line_section, dwarf_pubnames_section, dwarf_aranges_section) (dwarf_loc_section, dwarf_macinfo_section, dwarf_str_section) (dwarf_ranges_section, dwarf_frame_section) (dwarf_eh_frame_section): Removed. (dwarf2_resize_section): Likewise. (dwarf2_read_section): Now static, use bfd_mmap() if possible. (dwarf2_get_section_info): New function. (munmap_section_buffer): Likewise. (dwarf2_per_objfile_cleanup): Likewise. (section_is_p): Signature change. * dwarf2-frame.c (dwarf2_build_frame_info): Use dwarf2_get_section_info instead of dwarf2_read_section.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index ce11d89..cf080b3 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1896,15 +1896,9 @@ decode_frame_entry (struct comp_unit *unit, gdb_byte *start, int eh_frame_p)
}
-/* FIXME: kettenis/20030504: This still needs to be integrated with
- dwarf2read.c in a better way. */
-
-/* Imported from dwarf2read.c. */
-extern asection *dwarf_frame_section;
-extern asection *dwarf_eh_frame_section;
-
/* Imported from dwarf2read.c. */
-extern gdb_byte *dwarf2_read_section (struct objfile *objfile, asection *sectp);
+extern void dwarf2_get_section_info (struct objfile *, const char *, asection **,
+ gdb_byte **, bfd_size_type *);
void
dwarf2_build_frame_info (struct objfile *objfile)
@@ -1922,17 +1916,15 @@ dwarf2_build_frame_info (struct objfile *objfile)
/* First add the information from the .eh_frame section. That way,
the FDEs from that section are searched last. */
- if (dwarf_eh_frame_section)
+ dwarf2_get_section_info (objfile, ".eh_frame",
+ &unit->dwarf_frame_section,
+ &unit->dwarf_frame_buffer,
+ &unit->dwarf_frame_size);
+ if (unit->dwarf_frame_size)
{
asection *got, *txt;
unit->cie = NULL;
- unit->dwarf_frame_buffer = dwarf2_read_section (objfile,
- dwarf_eh_frame_section);
-
- unit->dwarf_frame_size = bfd_get_section_size (dwarf_eh_frame_section);
- unit->dwarf_frame_section = dwarf_eh_frame_section;
-
/* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
that is used for the i386/amd64 target, which currently is
the only target in GCC that supports/uses the
@@ -1952,13 +1944,13 @@ dwarf2_build_frame_info (struct objfile *objfile)
frame_ptr = decode_frame_entry (unit, frame_ptr, 1);
}
- if (dwarf_frame_section)
+ dwarf2_get_section_info (objfile, ".debug_frame",
+ &unit->dwarf_frame_section,
+ &unit->dwarf_frame_buffer,
+ &unit->dwarf_frame_size);
+ if (unit->dwarf_frame_size)
{
unit->cie = NULL;
- unit->dwarf_frame_buffer = dwarf2_read_section (objfile,
- dwarf_frame_section);
- unit->dwarf_frame_size = bfd_get_section_size (dwarf_frame_section);
- unit->dwarf_frame_section = dwarf_frame_section;
frame_ptr = unit->dwarf_frame_buffer;
while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)