public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type
@ 2021-07-21 10:13 vries at gcc dot gnu.org
  2021-07-21 12:19 ` [Bug ada/28115] " cvs-commit at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2021-07-21 10:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28115

            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=minimal: print pa_ptr(3)
...

This happens in ada_funcall_operation::evaluate here:
...
  if (type->code () == 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 = ada_value_ind (callee);
          type = 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-07 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 10:13 [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type vries at gcc dot gnu.org
2021-07-21 12:19 ` [Bug ada/28115] " cvs-commit at gcc dot gnu.org
2021-07-21 12:22 ` cvs-commit at gcc dot gnu.org
2021-09-07  9:42 ` vries at gcc dot gnu.org
2022-02-28 20:33 ` tromey at sourceware dot org
2022-02-28 20:44 ` tromey at sourceware dot org
2022-03-07 14:57 ` cvs-commit at gcc dot gnu.org
2022-03-07 14:58 ` tromey at sourceware dot org

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).