forked from Imagelibrary/binutils-gdb
Allow for anonymous Ada enumeration types
With some forthcoming changes to GNAT, gdb might see a nameless enum in ada_resolve_enum, causing a crash. This patch allows an anonymous enum type to be considered identical to a named type when the contents are identical.
This commit is contained in:
@@ -3796,7 +3796,10 @@ ada_resolve_enum (std::vector<struct block_symbol> &syms,
|
|||||||
for (int i = 0; i < syms.size (); ++i)
|
for (int i = 0; i < syms.size (); ++i)
|
||||||
{
|
{
|
||||||
struct type *type2 = ada_check_typedef (syms[i].symbol->type ());
|
struct type *type2 = ada_check_typedef (syms[i].symbol->type ());
|
||||||
if (strcmp (type1->name (), type2->name ()) != 0)
|
/* We let an anonymous enum type match a non-anonymous one. */
|
||||||
|
if (type1->name () != nullptr
|
||||||
|
&& type2->name () != nullptr
|
||||||
|
&& strcmp (type1->name (), type2->name ()) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (ada_identical_enum_types_p (type1, type2))
|
if (ada_identical_enum_types_p (type1, type2))
|
||||||
return i;
|
return i;
|
||||||
|
|||||||
Reference in New Issue
Block a user