This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix for dwz-related crash


*** TEST RESULTS FOR COMMIT 58f0c71853f98afe623ab89c4362682885905ebb ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: 58f0c71853f98afe623ab89c4362682885905ebb

Fix for dwz-related crash

PR symtab/23010 reports a crash that occurs when using -readnow
on a dwz-generated debuginfo file.

The crash occurs because the DWARF has a partial CU with no language
set, and then a full CU that references this partial CU using
DW_AT_abstract_origin.

In this case, the partial CU is read by dw2_expand_all_symtabs using
language_minimal; but then this conflicts with the creation of the
block's symbol table in the C++ CU.

This patch fixes the problem by arranging for partial CUs not to be
read by -readnow.  I tend to think that it doesn't make sense to read
a partial CU in isolation -- they should only be read when imported
into some other CU.

In conjunction with some other patches I am going to post, this also
fixes the Rust -readnow crash that Jan reported.

There are two problems with this patch:

1. It is difficult to reason about.  There are many cases where I've
   patched the code to call init_cutu_and_read_dies with the flag set
   to "please do read partial units" -- but I find it difficult to be
   sure that this is always correct.

2. It is still missing a standalone test case.  This seemed hard.

2018-05-17  Tom Tromey  <tom@tromey.com>

	PR symtab/23010:
	* dwarf2read.c (load_cu, dw2_do_instantiate_symtab)
	(dw2_instantiate_symtab): Add skip_partial parameter.
	(dw2_find_last_source_symtab, dw2_map_expand_apply)
	(dw2_lookup_symbol, dw2_expand_symtabs_for_function)
	(dw2_expand_all_symtabs, dw2_expand_symtabs_with_fullname)
	(dw2_expand_symtabs_matching_one)
	(dw2_find_pc_sect_compunit_symtab)
	(dw2_debug_names_lookup_symbol)
	(dw2_debug_names_expand_symtabs_for_function): Update.
	(init_cutu_and_read_dies): Add skip_partial parameter.
	(process_psymtab_comp_unit, build_type_psymtabs_1)
	(process_skeletonless_type_unit, load_partial_comp_unit)
	(psymtab_to_symtab_1): Update.
	(load_full_comp_unit): Add skip_partial parameter.
	(process_imported_unit_die, dwarf2_read_addr_index)
	(follow_die_offset, dwarf2_fetch_die_loc_sect_off)
	(dwarf2_fetch_constant_bytes, dwarf2_fetch_die_type_sect_off)
	(read_signatured_type): Update.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]