From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3479 invoked by alias); 7 Nov 2016 13:19:12 -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 3464 invoked by uid 89); 7 Nov 2016 13:19:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy=*avoid*, sk:ulrich, sk:ulrich. X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Nov 2016 13:19:09 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA7DIXhE117522 for ; Mon, 7 Nov 2016 08:19:08 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 26jpfk4qbe-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 07 Nov 2016 08:19:07 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Nov 2016 13:19:04 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 7 Nov 2016 13:19:01 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id E3DB01B08074 for ; Mon, 7 Nov 2016 13:21:12 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA7DJ0qe9634192 for ; Mon, 7 Nov 2016 13:19:00 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA7DJ0vs017829 for ; Mon, 7 Nov 2016 06:19:00 -0700 Received: from oc8523832656.ibm.com (dyn-9-152-213-198.boeblingen.de.ibm.com [9.152.213.198]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uA7DJ0lR017826; Mon, 7 Nov 2016 06:19:00 -0700 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id 74575108D19; Mon, 7 Nov 2016 14:18:59 +0100 (CET) Subject: Re: [PATCH 2/2] Remove parameter valaddr from la_val_print To: qiyaoltc@gmail.com (Yao Qi) Date: Mon, 07 Nov 2016 13:19:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <1478279691-25682-3-git-send-email-yao.qi@linaro.org> from "Yao Qi" at Nov 04, 2016 05:14:51 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110713-0040-0000-0000-00000254B5B9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110713-0041-0000-0000-00002275F933 Message-Id: <20161107131859.74575108D19@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-07_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611070248 X-SW-Source: 2016-11/txt/msg00133.txt.bz2 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