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 fortran/27341] [dwarf-5] FAIL: gdb.fortran/function-calls.exp: p derived_types_and_module_calls::pass_cart_nd(c_nd)
Date: Thu, 04 Feb 2021 09:48:43 +0000	[thread overview]
Message-ID: <bug-27341-4717-6pdHSwZqXp@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27341-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
This is due to missing support for DW_TAG_generic_subrange in read_array_type.

So we have:
...
 <1><e1e>: Abbrev Number: 46 (DW_TAG_array_type)
    <e1f>   DW_AT_data_location: 2 byte block: 97 6    
(DW_OP_push_object_address; DW_OP_deref)
    <e22>   DW_AT_rank        : 6 byte block: 97 23 10 6 37 1a
    <e29>   DW_AT_type        : <0x139>
    <e2d>   DW_AT_sibling     : <0xe51>
 <2><e31>: Abbrev Number: 47 (DW_TAG_generic_subrange)
    <e32>   DW_AT_lower_bound : 8 byte block: 97 14 48 1e 23 20 22 6   
(DW_OP_push_object_address; DW_OP_over; DW_OP_lit24; DW_OP_mul;
DW_OP_plus_uconst: 32; DW_OP_plus; DW_OP_deref)
    <e3b>   DW_AT_upper_bound : 8 byte block: 97 14 48 1e 23 28 22 6   
(DW_OP_push_object_address; DW_OP_over; DW_OP_lit24; DW_OP_mul;
DW_OP_plus_uconst: 40; DW_OP_plus; DW_OP_deref)
    <e44>   DW_AT_byte_stride : 11 byte block: 97 14 48 1e 23 18 22 6 8 38 1e  
(DW_OP_push_object_address; DW_OP_over; DW_OP_lit24; DW_OP_mul;
DW_OP_plus_uconst: 24; DW_OP_plus; DW_OP_deref; DW_OP_const1u: 56; DW_OP_mul)
...

We start out in read_array_type with:
...
  type = element_type;
...
and then iterate over range_types to build up the type further.

But there are no DW_TAG_subrange_type children (only one
DW_TAG_generic_subrange), so range_types is empty, and type is kept unmodified.

Consequently, in set_die_type we apply the DW_AT_data_location to the
element_type (the one at 0x139) instead of to the newly build array type.

Then we try to print c_nd:
...
 <2><6e8>: Abbrev Number: 2 (DW_TAG_variable)
    <6e9>   DW_AT_name        : (indirect string, offset: 0x218): c_nd
    <6ed>   DW_AT_decl_file   : 1
    <6ed>   DW_AT_decl_line   : 198
    <6ee>   DW_AT_type        : <0x139>
    <6f2>   DW_AT_location    : 9 byte block: 3 e0 30 60 0 0 0 0 0     
(DW_OP_addr: 6030e0)
...
and find that the type has a data_location property, which when used gives
incorrect results.

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

  parent reply	other threads:[~2021-02-04  9:48 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 22:39 [Bug fortran/27341] New: " vries at gcc dot gnu.org
2021-02-04  7:53 ` [Bug fortran/27341] " vries at gcc dot gnu.org
2021-02-04  9:48 ` vries at gcc dot gnu.org [this message]
2021-02-05 12:32 ` vries at gcc dot gnu.org
2021-02-09 22:28 ` cvs-commit at gcc dot gnu.org
2021-02-09 22:30 ` vries at gcc dot gnu.org
2021-02-09 22:31 ` vries at gcc dot gnu.org
2021-03-07 16:58 ` cvs-commit at gcc dot gnu.org
2021-03-07 16:59 ` vries at gcc dot gnu.org
2021-07-15  1:35 ` sherrixotyv29 at gmail dot com
2021-07-15  5:54 ` vries at gcc dot gnu.org
2021-07-21  4:06 ` ampva300 at gmail dot com
2021-07-21  7:21 ` vries at gcc dot gnu.org
2021-08-09  9:41 ` phillipsaeverett84 at gmail dot com
2021-08-10 11:45 ` ucelsanicin at yahoo dot com
2021-09-02 11:05 ` donipah907 at mtlcz dot com
2021-09-02 11:14 ` mark at klomp dot org
2021-09-06  9:06 ` focixujo at livinginsurance dot co.uk
2021-09-06  9:12 ` focixujo at livinginsurance dot co.uk
2021-09-10 19:40 ` mehmetgelisin at aol dot com
2021-09-22 16:40 ` mervegunesli at aol dot com
2021-09-26 13:31 ` tes.vik1986 at gmail dot com
2021-10-04  4:39 ` olivernicholle9052 at gmail dot com
2021-10-05  4:33 ` cartwrighthlmv67 at gmail dot com
2021-10-09 11:00 ` gulsenenginar at aol dot com
2021-10-10  3:40 ` cartwrighthlmv67 at gmail dot com
2021-10-10 16:11 ` oficaj3 at gmail dot com
2021-10-11 11:26 ` albertopyhy93 at gmail dot com
2021-10-18  6:45 ` pagefitzpatrick687 at gmail dot com
2021-10-18 19:57 ` ahmedsayeed1982 at hotmail dot com
2021-10-18 19:59 ` ahmedsayeed1982 at hotmail dot com
2021-10-19  7:14 ` progonsaytu at gmail dot com
2021-10-24 10:02 ` glassmtech at ukr dot net
2021-10-25  8:20 ` pagewhitehea034 at gmail dot com
2021-10-25 18:38 ` ahappliancerepair1 at gmail dot com
2021-10-29 10:57 ` kimolsun2020 at outlook dot com
2021-11-02  9:31 ` amosohxx90 at gmail dot com
2021-11-04  9:21 ` bahamianiridescent at gmail dot com
2021-11-05  9:27 ` bertbxi85 at gmail dot com
2021-11-08 11:50 ` richardsboyer67 at gmail dot com
2021-11-09 11:45 ` johnsjvi95 at gmail dot com
2021-11-17 13:02 ` blareblare2000mar at gmail dot com
2022-10-23 18:52 ` newcastlescaffolding at gmail dot com
2023-03-15  0:57 ` sz1922833 at gmail dot com
2023-03-15  0:57 ` sz1922833 at gmail dot com
2023-03-20  9:55 ` qas_07 at icloud dot com

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-27341-4717-6pdHSwZqXp@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: link
Be 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).