From: Daniel Jacobowitz <drow@false.org>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Simpify varobj children handling for C++
Date: Wed, 03 Jan 2007 22:32:00 -0000 [thread overview]
Message-ID: <20070103223207.GM17935@nevyn.them.org> (raw)
In-Reply-To: <emo1cf$b0v$1@sea.gmane.org>
On Mon, Dec 25, 2006 at 11:16:15AM +0300, Vladimir Prus wrote:
> * value.c (value_as_address): Use coerce_array_proper
> instead of coerce_array so that not fail for references.
> (coerce_array_proper): New function.
> (coerce_array): Use the above.
I definitely need more information on this. What fails beforehand,
and how did you get there?
> @@ -950,7 +950,8 @@ value_ind (struct value *arg1)
> if (TYPE_CODE (base_type) == TYPE_CODE_INT)
> return value_at_lazy (builtin_type_int,
> (CORE_ADDR) value_as_long (arg1));
> - else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
> + else if (TYPE_CODE (base_type) == TYPE_CODE_PTR
> + || TYPE_CODE (base_type) == TYPE_CODE_PTR)
> {
> struct type *enc_type;
> /* We may be pointing to something embedded in a larger object */
Something tells me you didn't actually need value_ind to handle
references... :-)
> +/* Given a value and a type of a variable object,
"the value and the type of a variable object", because
the value is the property of some specific variable object.
> + adjust those value and type to those necessary
"adjust the"
> + for getting childrens of the variable object.
"children"
> + This includes dereferencing top-level reference
> + to all types and dereferencing pointers to
> + structures.
"references" to match "all types"
> +static void
> +adjust_value_for_children_access (struct value **value,
> + struct type **type)
"adjust_value_for_child_access", also.
> +{
> + gdb_assert (type && *type);
> +
> + *type = check_typedef (*type);
> +
> + /* If the parent is reference, we always strip the
> + reference when getting children, since in C++,
> + reference is basically undistinguishable in
> + usage from a plain variable. */
"is a reference", "in C++, a reference".
> + /* The 'get_target_type' function call check_typedef on
"calls"
> @@ -1876,6 +1886,10 @@ c_describe_child (struct varobj *parent,
> if (cvalue && value)
> gdb_value_ind (value, cvalue);
>
> + /* The get_target_type function calls check_typedef
> + on the result. I'm not sure if showing check_typedefed
> + type for the child as opposed to the declared type is
> + right. */
> if (ctype)
> *ctype = get_target_type (type);
>
It'd be nice if we didn't do that. We go to some effort to show
typedefs in the CLI for ptype.
> + /* This is baseclass. */
"is a"
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-01-03 22:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-23 21:51 Vladimir Prus
2006-12-25 8:16 ` Vladimir Prus
2007-01-03 22:32 ` Daniel Jacobowitz [this message]
2007-01-17 18:57 ` Vladimir Prus
2007-01-20 19:42 ` Daniel Jacobowitz
2007-01-24 11:11 ` Vladimir Prus
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=20070103223207.GM17935@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=ghost@cs.msu.su \
/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