From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: qiyaoltc@gmail.com (Yao Qi)
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Remove parameter valaddr from la_val_print
Date: Mon, 07 Nov 2016 13:19:00 -0000 [thread overview]
Message-ID: <20161107131859.74575108D19@oc8523832656.ibm.com> (raw)
In-Reply-To: <1478279691-25682-3-git-send-email-yao.qi@linaro.org> from "Yao Qi" at Nov 04, 2016 05:14:51 PM
Yao Qi wrote:
> Nowadays, we pass both val and return value of
> value_contents_for_printing (val) to la_val_print. The latter is
> unnecessary. This patch removes the second parameter of la_val_print,
> and get valaddr in each language's implementation by calling
> value_contents_for_printing_const. This change makes a little
> difference, because value_contents_for_printing calls value_fetch_lazy
> additionally, so I call value_fetch_lazy in the caller of val_print
> if needed.
Can you explain why all those value_fetch_lazy calls are needed?
Did you add them only to keep the behavior the same as currently,
or does printing not work correctly if they are omitted?
I think we should *avoid* those calls as far as possible, since
they will cause data to be read from the target, which may in fact
not be necessary for this particular print operation (e.g. if only
a subobject is printed).
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2016-11-07 13:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 17:15 [PATCH 0/2] " Yao Qi
2016-11-04 17:15 ` [PATCH 1/2] use get_frame_register_value instead of deprecated_frame_register_read Yao Qi
2016-11-04 17:15 ` [PATCH 2/2] Remove parameter valaddr from la_val_print Yao Qi
2016-11-07 13:19 ` Ulrich Weigand [this message]
2016-11-07 14:24 ` Yao Qi
2016-11-07 14:36 ` Ulrich Weigand
[not found] <86wpge87zz.fsf@gmail.com>
2016-11-08 14:01 ` Ulrich Weigand
2016-11-08 15:29 ` Yao Qi
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=20161107131859.74575108D19@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