From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22607 invoked by alias); 12 Jan 2010 17:02:49 -0000 Received: (qmail 22543 invoked by uid 22791); 12 Jan 2010 17:02:48 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jan 2010 17:02:43 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0CH2faA008160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Jan 2010 12:02:41 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0CH2fSk023601; Tue, 12 Jan 2010 12:02:41 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o0CH2eKx023058; Tue, 12 Jan 2010 12:02:40 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 0CA33378187; Tue, 12 Jan 2010 10:02:40 -0700 (MST) From: Tom Tromey To: Phil Muldoon Cc: gdb-patches ml Subject: Re: [patch][python] Implement Python lazy strings (PR 10705) References: <4B4746A7.90309@redhat.com> <4B4B9867.5080805@redhat.com> Reply-To: tromey@redhat.com Date: Tue, 12 Jan 2010 17:02:00 -0000 In-Reply-To: <4B4B9867.5080805@redhat.com> (Phil Muldoon's message of "Mon, 11 Jan 2010 21:30:15 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2010-01/txt/msg00307.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Phil> + output = convert_value_from_python (string); Tom> Why do we need to do this? Tom> Can't we just get the address directly? Phil> As a lazy string is a pointer, the code needs to actually find the Phil> type associated with the characters in the string. So later in the Phil> code: Phil> if (TYPE_CODE (value_type (output)) == TYPE_CODE_PTR) Phil> output = value_ind (output); Yes, but calling convert_value_from_python means calling a method on the Lazy_string object to get a Value, then unpacking that -- but the actual pointer value is directly available in the object. Tom