* [PATCH][gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
@ 2021-02-05 12:29 Tom de Vries
2021-02-05 16:31 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2021-02-05 12:29 UTC (permalink / raw)
To: gdb-patches
Hi,
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.
Any comments?
Thanks,
- Tom
[gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
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.
---
gdb/dwarf2/read.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 424a0da3d6c..dd308ca7ba3 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7836,6 +7836,9 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
case DW_TAG_partial_unit:
this_cu->unit_type = DW_UT_partial;
break;
+ case DW_TAG_type_unit:
+ this_cu->unit_type = DW_UT_type;
+ break;
default:
abort ();
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH][gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
2021-02-05 12:29 [PATCH][gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit Tom de Vries
@ 2021-02-05 16:31 ` Tom Tromey
2021-02-05 17:17 ` Tom de Vries
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2021-02-05 16:31 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> 2021-02-05 Tom de Vries <tdevries@suse.de>
Tom> PR symtab/27333
Tom> * dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.
Looks good.
Tom> default:
Tom> abort ();
asserts are really for internal consistency checks, if this is using one
for data validation, then that's bad.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
2021-02-05 16:31 ` Tom Tromey
@ 2021-02-05 17:17 ` Tom de Vries
0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2021-02-05 17:17 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 2/5/21 5:31 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> 2021-02-05 Tom de Vries <tdevries@suse.de>
>
> Tom> PR symtab/27333
> Tom> * dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.
>
> Looks good.
>
> Tom> default:
> Tom> abort ();
>
> asserts are really for internal consistency checks, if this is using one
> for data validation, then that's bad.
Yeah, I'm not sure. It could be that unhandled units are supposed to be
blocked earlier, in which case this really is an internal consistency check.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-05 17:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 12:29 [PATCH][gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit Tom de Vries
2021-02-05 16:31 ` Tom Tromey
2021-02-05 17:17 ` Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox