From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D534385F021; Wed, 21 Jul 2021 10:13:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D534385F021 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type Date: Wed, 21 Jul 2021 10:13:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: vries 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 10:13:30 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28115 Bug ID: 28115 Summary: Support packed array encoded as DW_TAG_subrange_type Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: ada Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- With gcc-11, we have: ... (gdb) print pa_ptr(3)^M cannot subscript or call something of type `foo__packed_array_ptr'^M (gdb) FAIL: gdb.ada/arrayptr.exp: scenario=3Dminimal: print pa_ptr(3) ... This happens in ada_funcall_operation::evaluate here: ... if (type->code () =3D=3D TYPE_CODE_PTR) { switch (ada_check_typedef (TYPE_TARGET_TYPE (type))->code ()) ... because the case TYPE_CODE_RANGE is not handled. The dwarf looks like: ... <2><1667>: Abbrev Number: 5 (DW_TAG_variable) <1668> DW_AT_name : pa_ptr <166f> DW_AT_type : <0x1638> <2><1638>: Abbrev Number: 4 (DW_TAG_typedef) <1639> DW_AT_name : foo__packed_array_ptr <1640> DW_AT_type : <0x1644> <2><1644>: Abbrev Number: 6 (DW_TAG_pointer_type) <1645> DW_AT_byte_size : 8 <1646> DW_AT_type : <0x164a> <2><164a>: Abbrev Number: 7 (DW_TAG_subrange_type) <164b> DW_AT_lower_bound : 0 <164c> DW_AT_upper_bound : 18 byte block: 9e 10 ff ff ff ff ff ff ff = ff 3f 0 0 0 0 0 0 0 (DW_OP_implicit_value 16 byte block: ff ff ff ff ff ff ff= ff 3f 0 0 0 0 0 0 0 ) <165f> DW_AT_name : foo__packed_array <1663> DW_AT_type : <0x1720> <1667> DW_AT_artificial : 1 <1><1720>: Abbrev Number: 15 (DW_TAG_base_type) <1721> DW_AT_byte_size : 16 <1722> DW_AT_encoding : 7 (unsigned) <1723> DW_AT_name : (indirect string, offset: 0x204a): long_long_long_unsigned <1727> DW_AT_artificial : 1 ... A simple guess: ... diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index b098991612d..736007f737b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10605,6 +10605,8 @@ ada_funcall_operation::evaluate (struct type *expect_type, callee =3D ada_value_ind (callee); type =3D ada_check_typedef (TYPE_TARGET_TYPE (type)); break; + case TYPE_CODE_RANGE: + break; default: error (_("cannot subscript or call something of type `%s'"), ada_type_name (value_type (callee))); ... turns this into: ... (gdb) print pa_ptr(3)^M That operation is not available on integers of more than 8 bytes.^M (gdb) ... which turns things into a duplicate of PR20991 - "__int128 type support". Which is also how other related tests in the test-case fail. But I don't understand ada well enough to known whether the patch is actually correct. So at least for now, filing a separate PR. --=20 You are receiving this mail because: You are on the CC list for the bug.=