From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119684 invoked by alias); 8 Nov 2016 14:01:38 -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 119672 invoked by uid 89); 8 Nov 2016 14:01:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy= 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; Tue, 08 Nov 2016 14:01:35 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA8Dx0hQ097926 for ; Tue, 8 Nov 2016 09:01:34 -0500 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 26kf82btpa-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 08 Nov 2016 09:01:34 -0500 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Nov 2016 14:01:26 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp09.uk.ibm.com (192.168.101.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Nov 2016 14:01:25 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8172C17D8067 for ; Tue, 8 Nov 2016 14:03:45 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA8E1Op141812022 for ; Tue, 8 Nov 2016 14:01:24 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA8E1OYS015530 for ; Tue, 8 Nov 2016 07:01:24 -0700 Received: from oc8523832656.ibm.com (icon-9-164-133-101.megacenter.de.ibm.com [9.164.133.101]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uA8E1O3H015521; Tue, 8 Nov 2016 07:01:24 -0700 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id DF34310B7A8; Tue, 8 Nov 2016 15:01:22 +0100 (CET) Subject: Re: [PATCH 2/2] Remove parameter valaddr from la_val_print To: qiyaoltc@gmail.com (Yao Qi) Date: Tue, 08 Nov 2016 14:01:00 -0000 From: "Ulrich Weigand" Cc: qiyaoltc@gmail.com (Yao Qi), gdb-patches@sourceware.org (gdb-patches@sourceware.org) In-Reply-To: <86wpge87zz.fsf@gmail.com> from "Yao Qi" at Nov 08, 2016 12:35:12 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: 16110814-0036-0000-0000-000002555C06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110814-0037-0000-0000-0000132ACB23 Message-Id: <20161108140122.DF34310B7A8@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-08_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611080252 X-SW-Source: 2016-11/txt/msg00165.txt.bz2 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