From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: "Agovic, Sanimir" <sanimir.agovic@intel.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>,
"Boell, Keven" <keven.boell@intel.com>
Subject: Re: Variable Length Arrays (VLA) proposal
Date: Sun, 04 Aug 2013 19:02:00 -0000 [thread overview]
Message-ID: <20130804190156.GA31353@host2.jankratochvil.net> (raw)
In-Reply-To: <0377C58828D86C4588AEEC42FC3B85A7176288F9@IRSMSX105.ger.corp.intel.com>
On Fri, 28 Jun 2013 15:01:25 +0200, Agovic, Sanimir wrote:
> (3)
> Split struct type:
>
> The idea behind this proposal is to reflect the difference of types (dynamic/
> static attributes) in the type system used in GDB. At the moment we consider the
> following types:
>
> - struct type
> Serves as a base. Certain properties are exposed using function pointers
> instead of raw attribute access e.g. length, bounds.
>
> - struct static_type
> Reassembles the functionality of the current struct type. It is used for
> types with statically values of attributes.
>
> - struct dynamic type
> Allows to express the dynamic values of attributes. Computation of length
> and bounds might be done lazily.
>
> - struct typedef_type
> A simple proxy type. Calls to length and bounds are forwarded to the
> underlying type.
I think you would need also some:
- struct opaque_type
to resolve TYPE_IS_OPAQUE/TYPE_STUB/TYPE_TARGET_STUB types.
> Proposal (3) will make the type system of GDB more flexible, as differentiating
> between static and dynamic types. Also it will calculate dynamic attributes when
> they will be requested by the caller.
If you want to do the calculation any time when TYPE_ARRAY_UPPER_BOUND_VALUE
is called then you do not have the object address available - where will you
get it? The global pointer archer-jankratochvil-vla is using is really not
acceptable.
> An implementation details which is left out is whether one would implement it in
> a OO style similar to breakpoint_ops.
In part similar to breakpoint_ops but also similar to SYMBOL_IMPL - to save
the 8 bytes of a pointer - as struct type (main_type) should be very small.
Due to expansion of whole CUs (Compilation Units) together with CU
interdependencies one gets tons of struct type (main_type) instances
with C++ inferiors.
> Also
> extensions and future requirements could be better addressed by simply
> refactoring struct members into function pointers. The check_type function could
> be shortened, as function pointers will do the dynamic calculation work,
I believe you are now talking more about full struct type/main_type rework,
aren't you? It could be better to provide data definition samples.
Personally I do not think it is worth to start the struct type/main_type
rework in some pseudo-C++, before real C++ gets deployed.
> and in future steps completely removed by adding a function peel(), which
> would recursively peel of any typedefs. This change would be rather large
> and would affect many areas of GDB, like proposal (1).
I do not understand much this paragraph and I find it mostly off-topic here.
Callers of check_typedef currently expect all the typedefs get stripped so
I do not see who would be the callers for peel().
> The implementation of proposal (2) would be very isolated and simple, but will
> leave the static attributes in struct type, which are actually dynamic.
After all I find the (2) proposal the most one feasible, hooking into
value_type() together with some cleanups
like my-proposal (5) LA_VAL_PRINT->LA_VALUE_PRINT should make it working.
> However, also this change will be large as lots of GDB code need to be
> touched but it is the preferred proposal from our side.
As I see we found disagreement whether to go the (2) or (3) way I have placed
some question above which should clear it up what are your plans.
Thanks,
Jan
prev parent reply other threads:[~2013-08-04 19:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 13:03 Agovic, Sanimir
2013-06-28 15:40 ` Chris January
2013-07-01 1:55 ` Joel Brobecker
2013-07-01 8:01 ` Chris January
2013-07-01 15:32 ` Agovic, Sanimir
2013-07-04 8:18 ` Agovic, Sanimir
2013-07-04 9:13 ` Chris January
2013-07-04 11:49 ` Agovic, Sanimir
2013-07-04 16:55 ` Chris January
2013-07-26 11:44 ` Agovic, Sanimir
[not found] ` <1372928011.2796.13.camel@gumtree>
2013-07-04 10:00 ` Chris January
2013-07-02 13:37 ` Jan Kratochvil
2013-07-02 19:21 ` Jan Kratochvil
2013-07-02 22:22 ` Joel Brobecker
2013-07-04 12:32 ` Keven Boell
2013-08-04 19:33 ` Jan Kratochvil
2013-08-07 5:25 ` Keven Boell
2013-08-04 19:02 ` 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=20130804190156.GA31353@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--cc=keven.boell@intel.com \
--cc=sanimir.agovic@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