From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9CDB63858D1E; Thu, 7 Sep 2023 19:53:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CDB63858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694116404; bh=nK6Cu10JIpTfUTQZZBRmPQiAV/0dKzny8X7a4dr8NkE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GyAh4UHiuPJSDd+CxLMEFQDTpz4Fo85E25lECZh4rqwmAB9BC5J1d3mKksZ0w9ARA 6X3ITJcSZOHrVQwk3zGNTb7j2sOFOwWcIrzReDUAuiY+7wZJtNp/+OAnZleEDSpQjB 6j9syRQ3glwIwbzJ/FBLoUcZdyuWvFQiGcZDbcss= From: "cvs-commit at gcc dot gnu.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 19:53:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: ada X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29335 --- Comment #7 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D74c36641b0e9= 97ce81294e5bd4fe2d2ce017ea57 commit 74c36641b0e997ce81294e5bd4fe2d2ce017ea57 Author: Tom de Vries Date: Thu Sep 7 21:53:17 2023 +0200 [gdb/ada] Extend type equivalence test in ada_resolve_enum When running test-case gdb.ada/local-enum.exp with target board debug-types, I run into: ... (gdb) print v1(three)^M No name 'three' in enumeration type 'local__e1'^M (gdb) FAIL: gdb.ada/local-enum.exp: print v1 element ... The array V1 is of type A1 which is an array with index type E1, contai= ning "three" as enumerator: ... type E1 is (one, two, three); type A1 is array (E1) of Integer; V1 : A1 :=3D (0, 1, 2); ... There's also a type E2 that contains three as enumerator: ... type E2 is (three, four, five); ... When doing "print v1(three)", it's the job of ada_resolve_enum to resol= ve "three" to type E1 rather than type E2. When using target board debug-types, the enums E1 and E2 are replicated= in the .debug_types section, and consequently in ada_resolve_enum the type equivalence check using a pointer comparison fails: ... for (int i =3D 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 ()) =3D=3D context_ty= pe) return i; } ... Fix this by also trying a structural comparison using ada_identical_enum_types_p. Tested on x86_64-linux. Approved-By: Tom Tromey PR ada/29335 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29335 --=20 You are receiving this mail because: You are on the CC list for the bug.=