Convert the DWARF reader to new-style buildysm
authorTom Tromey <tom@tromey.com>
Tue, 22 May 2018 21:22:53 +0000 (15:22 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 20 Jul 2018 15:42:54 +0000 (09:42 -0600)
commit804d27291b2922f01fe5cc2d9ae759533d4a2f6f
tree13784436e6063553b98d20c4f48e547ecef48aff
parent80e649fcac86101a8a4581317e867e89de015d28
Convert the DWARF reader to new-style buildysm

This converts the DWARF reader to use the new-style buildsym API.  A
new buildsym_compunit is created for each CU and is used to construct
the symbol table.  In some cases the CU must be passed to functions
which previously did not accept it.  FWIW I tend to think that most
methods in the DWARF reader ought to be methods on the dwarf2_cu
object.

gdb/ChangeLog
2018-07-20  Tom Tromey  <tom@tromey.com>

* dwarf2read.c: Include buildsym.h.
(struct dwarf2_cu) <builder>: New method.
(fixup_go_packaging): Update.
(process_full_comp_unit, process_full_type_unit): Update.  Don't
use scoped_free_pendings.
(using_directives): Add "cu" parameter, remove "language".
(read_import_statement, setup_type_unit_groups, )
(read_func_scope, read_lexical_block_scope)
(dwarf2_record_block_ranges, read_namespace): Update.
(lnp_state_machine::lnp_state_machine): Add cu parameter.
(lnp_state_machine::handle_end_sequence): Update.
(class lnp_state_machine) <m_cu>: New member.
<m_record_line_callback>: Remove.
<m_currently_recording_lines>: New member.
(lnp_state_machine::handle_set_file): Update.
(noop_record_line): Remove.
(dwarf_record_line_p): Add cu parameter.
(dwarf_record_line_1, dwarf_finish_line): Likewise.
(lnp_state_machine::record_line)
(lnp_state_machine::lnp_state_machine)
(lnp_state_machine::check_line_address, dwarf_decode_lines_1)
(dwarf_decode_lines): Update.
(dwarf2_start_subfile): Add cu parameter.
(dwarf2_start_symtab, new_symbol): Update.
(macro_start_file, dwarf_decode_macro_bytes): Add cu parameter.
Remove dwarf2_per_objfile parameter.
(dwarf_decode_macros): Update.
gdb/ChangeLog
gdb/dwarf2read.c