binutils-gdb/gdb/dwarf2
Tom de Vries e77b0004dd [gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
When running test-case gdb.cp/cpexprs-debug-types.exp with target board
unix/gdb:debug_flags=-gdwarf-5, I run into:
...
(gdb) file cpexprs-debug-types^M
Reading symbols from cpexprs-debug-types...^M
ERROR: Couldn't load cpexprs-debug-types into GDB (eof).
ERROR: Couldn't send delete breakpoints to GDB.
ERROR: GDB process no longer exists
GDB process exited with wait status 23054 exp9 0 0 CHILDKILLED SIGABRT SIGABRT
...

We're running into this abort in process_psymtab_comp_unit:
...
  switch (reader.comp_unit_die->tag)
    {
    case DW_TAG_compile_unit:
      this_cu->unit_type = DW_UT_compile;
      break;
    case DW_TAG_partial_unit:
      this_cu->unit_type = DW_UT_partial;
      break;
    default:
      abort ();
    }
...
because reader.comp_unit_die->tag == DW_TAG_type_unit.

Fix this by adding a DW_TAG_type_unit case.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-02-05  Tom de Vries  <tdevries@suse.de>

	PR symtab/27333
	* dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.
2021-02-05 17:47:07 +01:00
..
abbrev.c
abbrev.h
attribute.c gdb/dwarf: few fixes for handling DW_FORM_{rng,loc}listx 2021-02-02 10:40:51 -05:00
attribute.h gdb/dwarf: few fixes for handling DW_FORM_{rng,loc}listx 2021-02-02 10:40:51 -05:00
comp-unit.c
comp-unit.h
die.h gdb/dwarf: split dwarf2_cu::ranges_base in two 2021-02-02 10:42:11 -05:00
dwz.c
dwz.h
expr.c
expr.h
frame-tailcall.c
frame-tailcall.h
frame.c
frame.h
index-cache.c
index-cache.h
index-common.c
index-common.h
index-write.c [gdb/symtab] Fix assert in write_one_signatured_type 2021-02-02 08:37:45 +01:00
index-write.h
leb.c
leb.h
line-header.c
line-header.h
loc.c Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
loc.h Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
macro.c
macro.h
read.c [gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit 2021-02-05 17:47:07 +01:00
read.h
section.c
section.h
stringify.c
stringify.h