From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89712 invoked by alias); 4 Nov 2016 19:20:13 -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 89280 invoked by uid 89); 4 Nov 2016 19:20:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Nov 2016 19:20:11 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F8F0C04B943; Fri, 4 Nov 2016 19:20:10 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-62.ams2.redhat.com [10.36.112.62]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA4JK9M6011996; Fri, 4 Nov 2016 15:20:09 -0400 Subject: Re: [PATCH, doc RFA] Fix lazy string type docs To: Doug Evans , gdb-patches , Eli Zaretskii References: <94eb2c1121f421b06405406923b6@google.com> From: Phil Muldoon Message-ID: Date: Fri, 04 Nov 2016 19:20:00 -0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00101.txt.bz2 On 04/11/16 17:52, Doug Evans wrote: > On Thu, Nov 3, 2016 at 5:00 PM, Doug Evans wrote: >> On Thu, Nov 3, 2016 at 12:03 PM, Doug Evans wrote: >>> On Thu, Nov 3, 2016 at 10:46 AM, Doug Evans wrote: >>>> Hi. >>>> >>> >>> (gdb) py print gdb.parse_and_eval("foo").lazy_string().type >>> const char >>> (gdb) py print gdb.parse_and_eval("bar").lazy_string().type >>> const char [19] >>> >>> I don't have a strong opinion on what the correct answer is, but there >>> is certainly a bug here. >>> >>> Phil, do you remember why this code exists in valpy_lazy_string(): >>> >>> if (TYPE_CODE (value_type (value)) == TYPE_CODE_PTR) >>> value = value_ind (value); >>> >>> [lazy string support went in in commit be759fcf] I can't remember. Too many sleeps ;) It's possible it is just a mistake and we're worrying about a bug that should just be fixed. I think lazy strings were implemented to carry around a string that remains unfetched (in cases of massive strings) until actually needed, or a pointer to that string. I also thought there was some work carried out on them by Tom (?) after the initial commit. I keep notes and I'll look on the weekend to see of I can dig out specific implementation details. Cheers Phil