Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: partially fix empty DW_OP_piece
Date: Wed, 02 Jun 2010 20:07:00 -0000	[thread overview]
Message-ID: <m3ocft2o6q.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20100602185354.GA11125@host0.dyn.jankratochvil.net> (Jan	Kratochvil's message of "Wed, 2 Jun 2010 20:53:54 +0200")

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

Jan>     int (*la_val_print) (struct type *type,
Jan>                          const gdb_byte *contents,
Jan>                          int embedded_offset, CORE_ADDR address,
Jan>                          struct ui_file *stream, int recurse,
Jan>                          const struct value_print_options *options);

Jan> There cannot be any `const gdb_byte *contents' for types with
Jan> DWARF_block* as their attribute (=TYPE_DYNAMIC from
Jan> archer-jankratochvil-vla) as DWARF expression evaluation
Jan> arbitrarily accesses inferior memory during DWARF_block* evaluation
Jan> for DW_AT_upper_bound and others.

I think the current gdb model is that a value is a snapshot of some
inferior state at a particular moment.

So, for VLA I would say that the bounds ought to be fixed at the time
the snapshot is taken.  I suppose this would mean introducing some copy
of the type.

Jan> OTOH there cannot be any `CORE_ADDR address' where the content
Jan> could be read from - for example for internal variables.

Yeah.  val_print doesn't usually read memory, though.  The address is
only occasionally used.

Tom> I started by looking briefly at replacing val_print.

Jan> Here you probably mean la_val_print->la_value_print unification:

Yes.

Tom> So, currently I am thinking I will go through my existing patch and have
Tom> it pass a value instead of lval_funcs.  Of course this means a lot of
Tom> redundant info, which is ugly.

Jan> Do you mean the unification proposed above or some other extension?

Right now what I've done is change val_print to:

int
val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
	   CORE_ADDR address, struct ui_file *stream, int recurse,
	   const struct value *val,
	   const struct value_print_options *options,
	   const struct language_defn *language)

That is, I added the new 'val' argument.  This is only used for bit
validity testing.

Jan> Couldn't be just the `struct value' kept LAZY and creating struct
Jan> values for the dereferenced elements only with properly adjusted
Jan> object address?

One problem is that not all values are lazy.  Also, record_latest_value
specifically makes a value not lazy, but this could be fixed somehow.

Maybe this problem is not very important though.

Tom


  reply	other threads:[~2010-06-02 20:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-14  6:39 Tom Tromey
2010-05-14 22:51 ` Jan Kratochvil
2010-05-21 19:48   ` Tom Tromey
2010-06-01 17:34   ` Tom Tromey
2010-06-02 18:54     ` Jan Kratochvil
2010-06-02 20:07       ` Tom Tromey [this message]
2010-06-03 17:46         ` Jan Kratochvil
2010-06-04 19:05           ` Tom Tromey
2010-06-04 19:10             ` Jan Kratochvil
2010-06-04 21:39               ` Tom Tromey
2010-06-04 21:47                 ` Jan Kratochvil
2010-05-20 23:04 ` Joel Brobecker

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=m3ocft2o6q.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@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