Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: plan: VLA (Variable Length Arrays) and Fortran dynamic types
Date: Thu, 29 Nov 2012 21:51:00 -0000	[thread overview]
Message-ID: <874nk83wok.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20121129144855.GA16288@host2.jankratochvil.net> (Jan	Kratochvil's message of "Thu, 29 Nov 2012 15:48:55 +0100")

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> Rename "struct type" to "struct abstract_type".  Make all
Jan> TYPE_LENGTH, TYPE_ARRAY_UPPER_BOUND_VALUE etc. macros accessing
Jan> concrete sizes requiring to provide also "struct value *".  Remove
Jan> check_typedef, that is hide it under the TYPE_LENGTH etc. macros.

Jan> This would also include work to pass "struct value *" mostly
Jan> everywhere instead of where current "struct type *" is passed as
Jan> one needs the inferior memory to find out the concrete dimensions
Jan> of inferior type.  This then makes the current *-vla implementation
Jan> of DW_AT_object_pointer easy.

[...]

Jan> Alternative approach would be to "concretize" abstract types by
Jan> check_typedef (which would be kept there).  In such case there
Jan> still would be "struct abstract_type" but there would be also
Jan> "struct concrete_type" which would automatically cache all the
Jan> values for better performance.  check_typedef would still be
Jan> impossible to forget like nowadays due to the non-compatible GDB
Jan> types "struct abstract_type" vs. "struct concrete_type".
Jan> archer-jankratochvil-vla does it this way (but still keeping
Jan> "struct type" being both the input and output GDB type of
Jan> check_typedef).  I do not think this approach is worth the pain.

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

I note that Ada already uses the concretizing approach.
Maybe Joel could share their experiences with this.

Tom


  reply	other threads:[~2012-11-29 21:51 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 [this message]
2012-11-29 22:09   ` Joel Brobecker
2012-11-30 15:50   ` Jan Kratochvil

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=874nk83wok.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@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