From: Tom Tromey <tom@tromey.com>
To: Nils-Christian Kempke via Gdb-patches <gdb-patches@sourceware.org>
Cc: Nils-Christian Kempke <nils-christian.kempke@intel.com>,
Bernhard Heckel <bernhard.heckel@intel.com>
Subject: Re: [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: add support for accessing fields of extended types
Date: Fri, 14 Jan 2022 13:06:13 -0700 [thread overview]
Message-ID: <87h7a6f5fu.fsf@tromey.com> (raw)
In-Reply-To: <20220113163909.2880018-2-nils-christian.kempke@intel.com> (Nils-Christian Kempke via Gdb-patches's message of "Thu, 13 Jan 2022 17:39:08 +0100")
>>>>> ">" == Nils-Christian Kempke via Gdb-patches <gdb-patches@sourceware.org> writes:
>> From: Bernhard Heckel <bernhard.heckel@intel.com>
>> Fortran 2003 supports type extension. This patch allows access
>> to inherited members by using their fully qualified name as described
>> in the Fortran standard.
Thanks for the patch.
>> In doing so the patch also fixes a bug in GDB when trying to access the
>> members of a base class in a derived class via the derived class' base
>> class member.
>> @@ -2374,6 +2374,12 @@ value_struct_elt (struct value **argp,
>> if (v)
>> return v;
>> + /* Fortran: If it is not a field it is the type name of an inherited
>> + structure. */
>> + v = search_struct_field (name, *argp, t, 1);
>> + if (v)
>> + return v;
Putting this here makes me wonder if it's possible to construct test
cases in other languages that would work without this patch and then
fail with it.
I'm not sure what the options are though. Doing the work elsewhere, say
in a custom Fortran expression operation, might make the Python API
harder to work with. Maybe having value_struct_elt check
current_language would work... that's also quite ugly but other value
operations are doing that.
Or maybe my fears are overblown.
Any thoughts on this?
Tom
next prev parent reply other threads:[~2022-01-14 20:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 16:39 [PATCH 0/2][PR fortran/26373][PR fortran/22497] GDB support for Fortran extends feature Nils-Christian Kempke
2022-01-13 16:39 ` [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: add support for accessing fields of extended types Nils-Christian Kempke
2022-01-14 20:06 ` Tom Tromey [this message]
2022-01-17 10:28 ` Kempke, Nils-Christian
2022-02-01 15:06 ` Kempke, Nils-Christian
2022-02-10 13:20 ` Kempke, Nils-Christian
2022-02-18 16:14 ` Kempke, Nils-Christian
2022-01-13 16:39 ` [PATCH 2/2] gdb/fortran: print fortran extended types with ptype Nils-Christian Kempke
2022-01-14 20:10 ` Tom Tromey
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=87h7a6f5fu.fsf@tromey.com \
--to=tom@tromey.com \
--cc=bernhard.heckel@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=nils-christian.kempke@intel.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).