Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] Remove parameter valaddr from la_val_print
Date: Mon, 07 Nov 2016 14:24:00 -0000	[thread overview]
Message-ID: <CAH=s-PPSXN4D94TC8K8PmNambgo88is+A1Afd3uAmv2V_03N8Q@mail.gmail.com> (raw)
In-Reply-To: <20161107131859.74575108D19@oc8523832656.ibm.com>

On Mon, Nov 7, 2016 at 1:18 PM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> 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?
>

The former.  Without my change, we pass the return value of
value_contents_for_printing to val_print, like this,

         val_print (elttype, value_contents_for_printing (v0),

and, value_contents_for_printing calls value_fetch_lazy.  After my
change, we start to use value_contents_for_printing_const in val_print
of each language, because VAL passed to val_print is const, so we
need to call value_fetch_lazy explicitly in the caller of val_print.

-- 
Yao (齐尧)


  reply	other threads:[~2016-11-07 14:24 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
2016-11-07 14:24     ` Yao Qi [this message]
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='CAH=s-PPSXN4D94TC8K8PmNambgo88is+A1Afd3uAmv2V_03N8Q@mail.gmail.com' \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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