Summary: | [gdb, debug-types, debug-names, dwarf-5] Support .debug_names section with TUs in .debug_info | ||
---|---|---|---|
Product: | gdb | Reporter: | Tom de Vries <vries> |
Component: | symtab | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | HEAD | ||
Target Milestone: | 13.1 | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Tom de Vries
2022-07-19 11:32:23 UTC
Part of enabling this will be to address the computation of CU size, which is broken for this use case. Tentative patch at PR29381 comment 3. (In reply to Tom de Vries from comment #1) > Part of enabling this will be to address the computation of CU size, which > is broken for this use case. Tentative patch at PR29381 comment 3. That's already taken care of in https://sourceware.org/pipermail/gdb-patches/2022-August/191313.html . Tentative patch (in combination with patch mentioned in previous comment): ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6c6ca96f8d9..8e82f464293 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -4736,13 +4736,16 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile) { /* We can only handle a single .debug_types when we have an index. */ - if (per_bfd->types.size () != 1) + if (per_bfd->types.size () > 1) { per_bfd->all_comp_units.clear (); return false; } - dwarf2_section_info *section = &per_bfd->types[0]; + dwarf2_section_info *section + = (per_bfd->types.size () == 1 + ? &per_bfd->types[0] + : &per_bfd->info); create_signatured_type_table_from_debug_names (per_objfile, *map, section, &per_bfd->abbrev); ... Allows test-case gdb.cp/cpexprs-debug-types.exp to pass on target board cc-with-debug-names/gdb:debug_flags=-gdwarf-5. |