public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug ada/29335] [gdb/ada, debug-types] FAIL: gdb.ada/local-enum.exp: print v1 element Date: Thu, 07 Sep 2023 10:27:26 +0000 [thread overview] Message-ID: <bug-29335-4717-RmX47QVBAF@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-29335-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=29335 --- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> --- Tentative patch: ... diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2e1b9664fdc..2496c099f19 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -204,6 +204,8 @@ static symbol_name_matcher_ftype *ada_get_symbol_name_matcher static int symbols_are_identical_enums (const std::vector<struct block_symbol> &syms); + +static int ada_identical_enum_types_p (struct type *type1, struct type *type2); /* The character set used for source files. */ @@ -3801,11 +3803,24 @@ ada_resolve_enum (std::vector<struct block_symbol> &syms, gdb_assert (context_type->code () == TYPE_CODE_ENUM); context_type = ada_check_typedef (context_type); + /* We already know the name matches, so we're just looking for + an element of the correct enum type. */ + struct type *type1 = context_type; + for (int i = 0; i < syms.size (); ++i) + { + struct type *type2 = ada_check_typedef (syms[i].symbol->type ()); + if (type1 == type2) + return i; + } + for (int i = 0; i < syms.size (); ++i) { - /* We already know the name matches, so we're just looking for - an element of the correct enum type. */ - if (ada_check_typedef (syms[i].symbol->type ()) == context_type) + struct type *type2 = ada_check_typedef (syms[i].symbol->type ()); + if (type1->num_fields () != type2->num_fields ()) + continue; + if (strcmp (type1->name (), type2->name ()) != 0) + continue; + if (ada_identical_enum_types_p (type1, type2)) return i; } ... -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2023-09-07 10:27 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-08 8:00 [Bug ada/29335] New: " vries at gcc dot gnu.org 2023-04-19 18:24 ` [Bug ada/29335] " tromey at sourceware dot org 2023-04-20 8:03 ` vries at gcc dot gnu.org 2023-04-20 8:57 ` vries at gcc dot gnu.org 2023-04-27 16:30 ` tromey at sourceware dot org 2023-09-07 10:27 ` vries at gcc dot gnu.org [this message] 2023-09-07 15:10 ` vries at gcc dot gnu.org 2023-09-07 19:53 ` cvs-commit at gcc dot gnu.org 2023-09-07 19:54 ` vries at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-29335-4717-RmX47QVBAF@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).