From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>,
rupothar <rupesh.potharla@amd.com>
Subject: Re: [PATCH 3/3] gdb: add support for Fortran's ASSUMED RANK arrays
Date: Fri, 01 Apr 2022 13:38:36 -0600 [thread overview]
Message-ID: <87zgl4lhkz.fsf@tromey.com> (raw)
In-Reply-To: <e13697193df3801668f8219e3b9662675e2459d8.1648036751.git.aburgess@redhat.com> (Andrew Burgess via Gdb-patches's message of "Wed, 23 Mar 2022 11:59:58 +0000")
>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:
Andrew> An alternative approach would be to make the rank value a
Andrew> gdb::optional, however, this ends up adding a bunch of complexity to
Andrew> the code (e.g. having to conditionally build the array to pass to
Andrew> dwarf2_evaluate_property, and handling the 'rank - 1' in
Andrew> resolve_dynamic_array_or_string_1) so I haven't done that, but could,
Andrew> if people think that would be a better approach.
I don't really have an opinion on this, but didn't want to just
completely ignore it either.
I did notice one oddity.
Andrew> + rank = 1;
Andrew> +
Andrew> + for (struct type *tmp_type = TYPE_TARGET_TYPE (type);
Andrew> + check_typedef (tmp_type)->code () == TYPE_CODE_ARRAY;
Andrew> + tmp_type = TYPE_TARGET_TYPE (tmp_type))
Andrew> + ++rank;
This loop calls check_typedef in the condition, but not when updating
tmp_type. Probably the update clause should also use check_typedef.
I don't know if Fortran even has typedefs, but its safe to do this.
Tom
next prev parent reply other threads:[~2022-04-01 19:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 17:57 [PATCH] Support for Fortran's ASSUMED RANK Potharla, Rupesh
2022-01-21 19:07 ` Andrew Burgess
2022-01-22 7:17 ` Potharla, Rupesh
2022-01-28 7:49 ` Potharla, Rupesh
2022-02-06 13:39 ` Andrew Burgess
2022-03-16 11:54 ` Potharla, Rupesh
2022-03-23 11:58 ` Andrew Burgess
2022-03-23 11:59 ` [PATCH 0/3] Fortran assumed rank array support Andrew Burgess
2022-03-23 11:59 ` [PATCH 1/3] gdb: small simplification in dwarf2_locexpr_baton_eval Andrew Burgess
2022-04-01 19:11 ` Tom Tromey
2022-03-23 11:59 ` [PATCH 2/3] gdb/dwarf: pass an array of values to the dwarf evaluator Andrew Burgess
2022-04-01 19:16 ` Tom Tromey
2022-03-23 11:59 ` [PATCH 3/3] gdb: add support for Fortran's ASSUMED RANK arrays Andrew Burgess
2022-04-01 19:38 ` Tom Tromey [this message]
2022-04-03 16:21 ` Andrew Burgess
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=87zgl4lhkz.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=rupesh.potharla@amd.com \
/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).