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>
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"));
}