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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  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 ` cvs-commit at gcc dot gnu.org
  2021-07-21 12:22 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-21 12:19 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0057a7ee0d963eb9aee5cdfb9d6da5279bc8caf9

commit 0057a7ee0d963eb9aee5cdfb9d6da5279bc8caf9
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Jul 21 14:19:51 2021 +0200

    [gdb/testsuite] Add KFAILs for gdb.ada FAILs with gcc-11

    With gcc-11 we run into:
    ...
    (gdb) print pa_ptr.all^M
    That operation is not available on integers of more than 8 bytes.^M
    (gdb) KFAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all (PRMS:
gdb/20991)
    ...

    This is due to PR exp/20991 - "__int128 type support".  Mark this and
similar
    FAILs as KFAIL.

    Also mark this FAIL:
    ....
    (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)
    ...
    as a KFAIL for PR ada/28115 - "Support packed array encoded as
    DW_TAG_subrange_type".

    Tested on x86_64-linux, with gcc-10 and gcc-11.

    gdb/testsuite/ChangeLog:

    2021-07-21  Tom de Vries  <tdevries@suse.de>

            * gdb.ada/arrayptr.exp: Add KFAILs for PR20991 and PR28115.
            * gdb.ada/exprs.exp: Add KFAILs for PR20991.
            * gdb.ada/packed_array_assign.exp: Same.

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

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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-21 12:22 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-11-branch branch has been updated by Tom de Vries
<vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f26101b199482bd13b5f9c45fb4f43a4eb8b16e6

commit f26101b199482bd13b5f9c45fb4f43a4eb8b16e6
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Jul 21 14:22:16 2021 +0200

    [gdb/testsuite] Add KFAILs for gdb.ada FAILs with gcc-11

    With gcc-11 we run into:
    ...
    (gdb) print pa_ptr.all^M
    That operation is not available on integers of more than 8 bytes.^M
    (gdb) KFAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all (PRMS:
gdb/20991)
    ...

    This is due to PR exp/20991 - "__int128 type support".  Mark this and
similar
    FAILs as KFAIL.

    Also mark this FAIL:
    ....
    (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)
    ...
    as a KFAIL for PR ada/28115 - "Support packed array encoded as
    DW_TAG_subrange_type".

    Tested on x86_64-linux, with gcc-10 and gcc-11.

    gdb/testsuite/ChangeLog:

    2021-07-21  Tom de Vries  <tdevries@suse.de>

            * gdb.ada/arrayptr.exp: Add KFAILs for PR20991 and PR28115.
            * gdb.ada/exprs.exp: Add KFAILs for PR20991.
            * gdb.ada/packed_array_assign.exp: Same.

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

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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-07  9:42 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Hmm, this recent gcc commit looks interesting:
...
commit c0b03afeab4502da3040ef1ebbd28f826737fa8a
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Mon Sep 6 11:16:08 2021 +0200

    Fix debug info for packed array types in Ada

    Packed array types are sometimes represented with integer types under the
    hood in Ada, but we nevertheless need to emit them as array types in the
    debug info so we have the types.get_array_descr_info langhook for this
    purpose; but it is not invoked from modified_type_die, which causes:

    FAIL: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr.all
    FAIL: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr.all(3)

    in the GDB testsuite.

    gcc/
            * dwarf2out.c (modified_type_die): Deal with all array types
earlier
            and use local variable consistently throughout the function.
...

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

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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  2021-07-21 10:13 [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2022-02-28 20:33 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
With gcc 12 (random build of gcc trunk) this works:

# of expected passes            22

whereas with 11 (fedora 34 system gcc):

# of expected passes            19
# of unexpected failures        2
# of known failures             1


So I think this is a compiler bug.
I guess we could kfail it.

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

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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  2021-07-21 10:13 [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2022-02-28 20:44 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2022-February/186199.html

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

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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  2021-07-21 10:13 [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-07 14:57 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=47a39c6e18324360b3ef9b72f03e206417f2ce9c

commit 47a39c6e18324360b3ef9b72f03e206417f2ce9c
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Feb 28 13:42:03 2022 -0700

    Fix gdb.ada/arrayptr.exp results

    PR ada/28115 points out that gdb.ada/arrayptr.exp works with GNAT 12,
    but fails with minimal encodings in earlier versions.

    This patch updates the test to try to report the results correctly.  I
    tried this with the Fedora 34 system gcc (GCC 11) and with a GCC 12
    built from git trunk sometime relatively recently.

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

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

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

* [Bug ada/28115] Support packed array encoded as DW_TAG_subrange_type
  2021-07-21 10:13 [Bug ada/28115] New: Support packed array encoded as DW_TAG_subrange_type vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-03-07 14:57 ` cvs-commit at gcc dot gnu.org
@ 2022-03-07 14:58 ` tromey at sourceware dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2022-03-07 14:58 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |12.1
             Status|NEW                         |RESOLVED

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

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