Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: qiyaoltc@gmail.com (Yao Qi)
Cc: qiyaoltc@gmail.com (Yao Qi),
	       gdb-patches@sourceware.org (gdb-patches@sourceware.org)
Subject: Re: [PATCH 2/2] Remove parameter valaddr from la_val_print
Date: Tue, 08 Nov 2016 14:01:00 -0000	[thread overview]
Message-ID: <20161108140122.DF34310B7A8@oc8523832656.ibm.com> (raw)
In-Reply-To: <86wpge87zz.fsf@gmail.com> from "Yao Qi" at Nov 08, 2016 12:35:12 PM

Yao Qi wrote:

> If we go to the direction you suggested, val_print routines shouldn't
> assume that VAL contents are already fetched.  Before we do printing,
> optimized-out checking, or available checking, we should make sure VAL
> is not lazy.  Nowadays, we can't fetch the value partially, because
> 'lazy' is a bool attribute, we either fetched all contents or haven't
> fetch all contents.

Right.  But if we ever went to actually create sub-value objects, then
we might be able to take advantage of only fetching the contents for
those sub-objects are actually printed.  In any case, I still think
this new patch is preferable over calling value_fetch_lazy all the
time ...

> How is the patch below?  I don't write the ChangeLog entry yet.
> Regression tested on x86_64-linux.

Looks good to me.

> --- a/gdb/extension.c
> +++ b/gdb/extension.c
> @@ -478,9 +478,9 @@ free_ext_lang_type_printers (struct ext_lang_type_print=
> ers *printers)
>    xfree (printers);
>  }
>  =0C
> -/* Try to pretty-print a value of type TYPE located at VALADDR
> -   + EMBEDDED_OFFSET, which came from the inferior at address ADDRESS
> -   + EMBEDDED_OFFSET, onto stdio stream STREAM according to OPTIONS.
> +/* Try to pretty-print a value of type TYPE located at VAL's contents
> +   buffer + EMBEDDED_OFFSET, which came from the inferior at address
> +   ADDRESS + EMBEDDED_OFFSET, onto stdio stream STREAM according to OPTION=
> S.
>     VAL is the whole object that came from ADDRESS.  VALADDR must point to
>     the head of VAL's contents buffer.
>     Returns non-zero if the value was successfully pretty-printed.

This changes the comment but not the actual implementation, this seems
to be an oversight?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


       reply	other threads:[~2016-11-08 14:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <86wpge87zz.fsf@gmail.com>
2016-11-08 14:01 ` Ulrich Weigand [this message]
2016-11-08 15:29   ` Yao Qi
2016-11-04 17:15 [PATCH 0/2] " Yao Qi
2016-11-04 17:15 ` [PATCH 2/2] " Yao Qi
2016-11-07 13:19   ` Ulrich Weigand
2016-11-07 14:24     ` Yao Qi
2016-11-07 14:36       ` Ulrich Weigand

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=20161108140122.DF34310B7A8@oc8523832656.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.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