aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-01-16 19:10:12 -0700
committerTom Tromey <tom@tromey.com>2024-01-17 06:15:27 -0700
commit2002c0099f9fb4d737930acd66733cfad39f68f1 (patch)
tree19e63022a60746f6e616318ea3968365b7328248 /gdb/dwarf2/read.c
parent8061bf5faa8540a77fab8156ae1da816ac0e3c33 (diff)
downloadgdb-2002c0099f9fb4d737930acd66733cfad39f68f1.zip
gdb-2002c0099f9fb4d737930acd66733cfad39f68f1.tar.gz
gdb-2002c0099f9fb4d737930acd66733cfad39f68f1.tar.bz2
Fix crash in struct-with-sig-2.exp with debug-names target board
When I run the struct-with-sig-2.exp test with the .debug_names-using target board, I see a gdb crash. This happens because the reader throws an exception without calling finalize_all_units. This causes an assertion failure later because the number of CUs and TUs doesn't match. The fix is to clear 'all_units' on failure. Approved-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r--gdb/dwarf2/read.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 1b5e566..8f2b7a3 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -5193,6 +5193,8 @@ create_all_units (dwarf2_per_objfile *per_objfile)
if (!dwz->types.empty ())
{
+ per_objfile->per_bfd->all_units.clear ();
+
/* See enhancement PR symtab/30838. */
error (_("Dwarf Error: .debug_types section not supported in dwz file"));
}