From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28009 invoked by alias); 7 Nov 2016 14:24:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27930 invoked by uid 89); 7 Nov 2016 14:24:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:uweigan, uweigand@de.ibm.com, U*uweigand, uweiganddeibmcom X-HELO: mail-qk0-f178.google.com Received: from mail-qk0-f178.google.com (HELO mail-qk0-f178.google.com) (209.85.220.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Nov 2016 14:24:56 +0000 Received: by mail-qk0-f178.google.com with SMTP id n204so167209875qke.2 for ; Mon, 07 Nov 2016 06:24:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wv9YTpocTOgvuxRUDar7oCKHGMTciGY4pxYooAoJEWo=; b=nJat1JLCfzIn5Dm6ZYSz/Td7RuSSG8gw8h8p3FHN6t69maygCEViBg/bj2QaCwL0oo tcdjei3QJrYMuliX2vayO5UmEzpwbdd90gwOINm4eRqwezdreXVP/0tmcTRt60j60mM0 0yEL7X+xfFk69dx6hKQFJQ/smwV7w7GEBM8r13pZkLtRmKoBqsbanbln14Z4lD3U4v6s uIk4qRxL0kVtBkwlDeAhpw/Z0MkCnBTmg7laQuZjfU0h3+Thv9lZAM/cenD3R0bvjyIf yrQgayuDkRgld19tIO0Yu/u9R8ysGREe593XETgZMGfDR+2Yxka1FsAxI/5N47lGgw+q uxVA== X-Gm-Message-State: ABUngvd3iDYOdKz/2SVKo6qdUgJE7Ia45mehnT/A5JyxWZTRDoE9vhq6JhVjt4XNDrhJGgfeGdTcpArwsG9dJg== X-Received: by 10.233.239.65 with SMTP id d62mr7830897qkg.122.1478528695034; Mon, 07 Nov 2016 06:24:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.149.55 with HTTP; Mon, 7 Nov 2016 06:24:54 -0800 (PST) In-Reply-To: <20161107131859.74575108D19@oc8523832656.ibm.com> References: <1478279691-25682-3-git-send-email-yao.qi@linaro.org> <20161107131859.74575108D19@oc8523832656.ibm.com> From: Yao Qi Date: Mon, 07 Nov 2016 14:24:00 -0000 Message-ID: Subject: Re: [PATCH 2/2] Remove parameter valaddr from la_val_print To: Ulrich Weigand Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00135.txt.bz2 On Mon, Nov 7, 2016 at 1:18 PM, Ulrich Weigand 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. --=20 Yao (=E9=BD=90=E5=B0=A7)