From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1617 invoked by alias); 12 Mar 2012 21:04:30 -0000 Received: (qmail 1602 invoked by uid 22791); 12 Mar 2012 21:04:29 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Mon, 12 Mar 2012 21:04:14 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2CL4C61024203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Mar 2012 17:04:13 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2CL4BQF017361 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 12 Mar 2012 17:04:12 -0400 From: Tom Tromey To: Siva Chandra Cc: gdb-patches@sourceware.org Subject: Re: [RFC - Python Scripting] Extend Value.dereference to dereference C++ reference values References: <8762e9ppxq.fsf@fleche.redhat.com> Date: Mon, 12 Mar 2012 21:04:00 -0000 In-Reply-To: <8762e9ppxq.fsf@fleche.redhat.com> (Tom Tromey's message of "Mon, 12 Mar 2012 13:41:37 -0600") Message-ID: <87399do7jo.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2012-03/txt/msg00417.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Siva> Unless I am missing something, I couldn't find anything which can do Siva> this in the Python API. Attached is a patch which extends the Python Siva> API method Value.dereference to 'dereference' C++ reference values as Siva> well. I am probably overloading the term 'dereference' as used in the Siva> normal (pointer dereferencing) sense. Tom> I think that is fine. [...] Tom> The code bits are ok with those changes. Oops, sorry, I am mistaken about this. Right now, value_ind calls coerce_array, which calls coerce_ref. So, if you have a reference to a pointer, Value.dereference will end up dereferencing the pointer. So, if your patch went in, it would be an incompatible change. I think you will have to have a new method for this instead. Tom