diff options
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 6 | ||||
-rw-r--r-- | gdb/psymtab.c | 4 | ||||
-rw-r--r-- | gdb/psymtab.h | 17 |
4 files changed, 27 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 211867de175..81f07f774d9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2019-01-10 Tom Tromey <tom@tromey.com> + * psymtab.h (psymtab_storage::obstack): New method. + <m_obstack>: Rename from obstack; now private. + * psymtab.c (psymtab_storage): Update. + * dwarf2read.c (create_addrmap_from_index) + (create_addrmap_from_aranges, dwarf2_build_psymtabs_hard): + Update. + +2019-01-10 Tom Tromey <tom@tromey.com> + * symfile.c (reread_symbols): Call objfile->reset_psymtabs. * objfiles.h (objfile::reset_psymtabs): New method. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a0365f56b86..97ca3414b02 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3191,7 +3191,7 @@ create_addrmap_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile, } objfile->partial_symtabs->psymtabs_addrmap - = addrmap_create_fixed (mutable_map, &objfile->objfile_obstack); + = addrmap_create_fixed (mutable_map, objfile->partial_symtabs->obstack ()); } /* Read the address map data from DWARF-5 .debug_aranges, and use it to @@ -3352,7 +3352,7 @@ create_addrmap_from_aranges (struct dwarf2_per_objfile *dwarf2_per_objfile, } objfile->partial_symtabs->psymtabs_addrmap - = addrmap_create_fixed (mutable_map, &objfile->objfile_obstack); + = addrmap_create_fixed (mutable_map, objfile->partial_symtabs->obstack ()); } /* Find a slot in the mapped index INDEX for the object named NAME. @@ -8491,7 +8491,7 @@ dwarf2_build_psymtabs_hard (struct dwarf2_per_objfile *dwarf2_per_objfile) objfile->partial_symtabs->psymtabs_addrmap = addrmap_create_fixed (objfile->partial_symtabs->psymtabs_addrmap, - &objfile->objfile_obstack); + objfile->partial_symtabs->obstack ()); /* At this point we want to keep the address map. */ save_psymtabs_addrmap.release (); diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 7af82d6327c..e1854412677 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -68,8 +68,8 @@ static struct compunit_symtab *psymtab_to_symtab (struct objfile *objfile, psymtab_storage::psymtab_storage (struct objfile *objfile) - : obstack (&objfile->objfile_obstack), - psymbol_cache (psymbol_bcache_init ()) + : psymbol_cache (psymbol_bcache_init ()), + m_obstack (&objfile->objfile_obstack) { } diff --git a/gdb/psymtab.h b/gdb/psymtab.h index 895f950a466..d0e596980d1 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -55,6 +55,13 @@ public: void discard_psymtab (struct partial_symtab *pst); + /* Return the obstack that is used for storage by this object. */ + + struct obstack *obstack () + { + return m_obstack; + } + /* Each objfile points to a linked list of partial symtabs derived from this file, one partial symtab structure for each compilation unit @@ -73,10 +80,6 @@ public: struct partial_symtab *free_psymtabs = nullptr; - /* The obstack where allocations are made. */ - - struct obstack *obstack; - /* A byte cache where we can stash arbitrary "chunks" of bytes that will not change. */ @@ -87,6 +90,12 @@ public: std::vector<partial_symbol *> global_psymbols; std::vector<partial_symbol *> static_psymbols; + +private: + + /* The obstack where allocations are made. */ + + struct obstack *m_obstack; }; |