Integrate new symtab reader into corpus and read_context
While reading the corpus in the read_context, also load the new type
symtab object side-by-side and set it accordingly in the resulting
corpus. This is still side by side and passive code that gets active in
the following changes. This is applicable for the dwarf reader as well
as for the reader that consumes XML.
* include/abg-corpus.h (corpus::set_symtab): New method declaration.
(corpus::get_symtab): New method declaration.
* include/abg-fwd.h (symtab_reader::symtab_sptr): New forward
declaration.
* src/abg-corpus-priv.h (corpus::priv::symtab_): New data member.
* src/abg-corpus.cc
(corpus::set_symtab): Likewise.
(corpus::get_symtab): Likewise.
* src/abg-dwarf-reader.cc (read_context::symtab_): New data member.
(read_context::initialize): reset symtab_ as well
(read_context::symtab): new method that loads a symtab on
first access and returns it.
(read_debug_info_into_corpus): also set the new symtab object
on the current corpus.
(read_corpus_from_elf): Also determine (i.e. load) the new
symtab object and contribute to the load status.
* src/abg-reader.cc (read_corpus_from_input): also set the new
type symtab when reading from xml.
* tests/test-symtab.cc: Add test assertions.
Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I3210c628c1b1f370cccc4e0730051612b3e4b36f
9 files changed