mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
* dwarf2read.c (psymtabs_addrmap_cleanup): New function.
(dwarf2_build_psymtabs_hard): Use it. Create addrmap on a temporary obstack.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2010-06-17 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* dwarf2read.c (psymtabs_addrmap_cleanup): New function.
|
||||||
|
(dwarf2_build_psymtabs_hard): Use it. Create addrmap on a
|
||||||
|
temporary obstack.
|
||||||
|
|
||||||
2010-06-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
2010-06-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
Jan Kratochvil <jan.kratochvil@redhat.com>
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
@ -1995,6 +1995,15 @@ build_type_psymtabs (struct objfile *objfile)
|
|||||||
process_type_comp_unit, objfile);
|
process_type_comp_unit, objfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A cleanup function that clears objfile's psymtabs_addrmap field. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
psymtabs_addrmap_cleanup (void *o)
|
||||||
|
{
|
||||||
|
struct objfile *objfile = o;
|
||||||
|
objfile->psymtabs_addrmap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Build the partial symbol table by doing a quick pass through the
|
/* Build the partial symbol table by doing a quick pass through the
|
||||||
.debug_info and .debug_abbrev sections. */
|
.debug_info and .debug_abbrev sections. */
|
||||||
|
|
||||||
@ -2002,7 +2011,8 @@ static void
|
|||||||
dwarf2_build_psymtabs_hard (struct objfile *objfile)
|
dwarf2_build_psymtabs_hard (struct objfile *objfile)
|
||||||
{
|
{
|
||||||
gdb_byte *info_ptr;
|
gdb_byte *info_ptr;
|
||||||
struct cleanup *back_to;
|
struct cleanup *back_to, *addrmap_cleanup;
|
||||||
|
struct obstack temp_obstack;
|
||||||
|
|
||||||
dwarf2_read_section (objfile, &dwarf2_per_objfile->info);
|
dwarf2_read_section (objfile, &dwarf2_per_objfile->info);
|
||||||
info_ptr = dwarf2_per_objfile->info.buffer;
|
info_ptr = dwarf2_per_objfile->info.buffer;
|
||||||
@ -2015,8 +2025,12 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile)
|
|||||||
|
|
||||||
create_all_comp_units (objfile);
|
create_all_comp_units (objfile);
|
||||||
|
|
||||||
objfile->psymtabs_addrmap =
|
/* Create a temporary address map on a temporary obstack. We later
|
||||||
addrmap_create_mutable (&objfile->objfile_obstack);
|
copy this to the final obstack. */
|
||||||
|
obstack_init (&temp_obstack);
|
||||||
|
make_cleanup_obstack_free (&temp_obstack);
|
||||||
|
objfile->psymtabs_addrmap = addrmap_create_mutable (&temp_obstack);
|
||||||
|
addrmap_cleanup = make_cleanup (psymtabs_addrmap_cleanup, objfile);
|
||||||
|
|
||||||
/* Since the objects we're extracting from .debug_info vary in
|
/* Since the objects we're extracting from .debug_info vary in
|
||||||
length, only the individual functions to extract them (like
|
length, only the individual functions to extract them (like
|
||||||
@ -2048,6 +2062,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile)
|
|||||||
|
|
||||||
objfile->psymtabs_addrmap = addrmap_create_fixed (objfile->psymtabs_addrmap,
|
objfile->psymtabs_addrmap = addrmap_create_fixed (objfile->psymtabs_addrmap,
|
||||||
&objfile->objfile_obstack);
|
&objfile->objfile_obstack);
|
||||||
|
discard_cleanups (addrmap_cleanup);
|
||||||
|
|
||||||
do_cleanups (back_to);
|
do_cleanups (back_to);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user