From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: plan: VLA (Variable Length Arrays) and Fortran dynamic types
Date: Fri, 30 Nov 2012 15:50:00 -0000 [thread overview]
Message-ID: <20121130154951.GA8208@host2.jankratochvil.net> (raw)
In-Reply-To: <874nk83wok.fsf@fleche.redhat.com>
On Thu, 29 Nov 2012 22:51:07 +0100, Tom Tromey wrote:
> Passing a struct value everywhere seems pretty awful though too,
> especially considering that one may not generally have a value.
> 'ptype' and plenty of other things have to work on the abstract type.
There is needed 'struct value' with some dummy content in such case.
It also means you cannot 'ptype' VLA type (or dynamic Fortran array), you need
an inferior variable instance for VLA.
I have checked now that 'ptype char[5]' works even without VLA. But that sets
TYPE_LENGTH to 5 and TYPE_TARGET_STUB == 0 so check_typedef does not overwrite
the value 5 (it also has no TYPE_CODE_RANGE anywhere).
Dummy 'struct value' is the disadvantage of a fully dynamic solution but it is
nice we share the opinion with Joel a fully dynamic solution (without
concretization) should be better.
I did not use you words 'abstract type' as I used 'struct abstract_type' in my
text also for inferior types not yet passed through check_typedef.
For non-VLA types it means 'struct abstract_type' may be opaque type.
> But I think maybe I don't understand some details here. Could you give
> an example of where we pass a type now that we would have to pass a
> value in the future?
It may also depend a bit on the behavior currently in archer-jankratochvil-vla
as:
(gdb) whatis temp1
type = char [variable]
(gdb) ptype temp1
type = char [78]
Currently it did mean how many check_typedefs to call, with fully dynamic
types in GDB there will need to be different way (flag) to access the array
bound value.
For example LA_PRINT_TYPE parameter type -> value. I do not know more, just
change type->value at any TYPE_LENGTH and similar accessors, and then change
it in all the callers.
Jan
prev parent reply other threads:[~2012-11-30 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-29 14:49 Jan Kratochvil
2012-11-29 21:51 ` Tom Tromey
2012-11-29 22:09 ` Joel Brobecker
2012-11-30 15:50 ` Jan Kratochvil [this message]
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=20121130154951.GA8208@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--cc=tromey@redhat.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