Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 11/12] entryval#2: @entry values even for references
Date: Fri, 23 Sep 2011 12:02:00 -0000	[thread overview]
Message-ID: <20110923113941.GA14054@host1.jankratochvil.net> (raw)
In-Reply-To: <201109231050.22720.pedro@codesourcery.com>

On Fri, 23 Sep 2011 11:50:22 +0200, Pedro Alves wrote:
> Sorry, in the hurry, I hadn't noticed you had used `S &s; class S { char a, b; };'.
> That's not the case I raised originally.  The case is an entry val of
> type `struct { int a; long &b; }'.  Calling an entry object of that
> type `s', if we "print s@entry", I think we'll:

In such case the parameter `s' is not TYPE_CODE_REF and therefore
entry_data_value_funcs do not get ever used and therefore
coerce_ref_if_computed will always return NULL.

coerce_ref_if_computed is there only as a hack for TYPE_CODE_REF which
dereferences into something else than what a native normal such
TYPE_CODE_REF-pointer would derefefence into.

I had a former version of the patch which did not use coerce_ref_if_computed
and if it has seen TYPE_CODE_REF with both DW_AT_GNU_call_site_value (=the
pointer) and DW_AT_GNU_call_site_data_value (=the dereferenced data) then it
created non-lazy lval_memory object of TYPE_TARGET_TYPE type with
value_address set to that reference-pointer. But such case was (a) confusing
because `ptype param' and `ptype param@entry' could be different and (b)
dangerous as param@entry was modifiable due to its lval_memory (it is not_lval
now).


> print A (TYPE_CODE_INT) at embedded_offset 0 of S, and then B
> at embedded_offset==offsetof(typeof(s), b) of S (e.g., 8).  B will
> be TYPE_CODE_REF here, and coerce_ref_if_computed on S will wrongly

coerce_ref_if_computed will be NULL as there is no coerce_ref_if_computed
anywhere present.

> operate on the contents of the whole S (because it loses embedded_offset),
> instead of working with the B contents of S.


Thanks,
Jan


  reply	other threads:[~2011-09-23 11:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-13 19:52 Jan Kratochvil
2011-09-16 12:29 ` Pedro Alves
2011-09-16 19:15   ` Jan Kratochvil
2011-09-21 15:54     ` Pedro Alves
2011-09-22 22:49       ` Jan Kratochvil
2011-09-23  6:02         ` Pedro Alves
2011-09-23  8:37           ` Jan Kratochvil
2011-09-23 10:27             ` Pedro Alves
2011-09-23 12:02               ` Jan Kratochvil [this message]
2011-09-23 12:08                 ` Pedro Alves
2011-09-23 15:04                   ` 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=20110923113941.GA14054@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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