From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35575 invoked by alias); 31 Mar 2016 20:35:41 -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 35565 invoked by uid 89); 31 Mar 2016 20:35:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1776 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 31 Mar 2016 20:35:39 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 81AF871089; Thu, 31 Mar 2016 20:35:38 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2VKZbeI025508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Mar 2016 16:35:38 -0400 From: Keith Seitz Subject: Re: [PATCH v4 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module To: Artemiy Volkov , gdb-patches@sourceware.org References: <1457147955-21871-1-git-send-email-artemiyv@acm.org> <1458593958-25656-1-git-send-email-artemiyv@acm.org> <1458593958-25656-9-git-send-email-artemiyv@acm.org> Message-ID: <56FD8A19.8050403@redhat.com> Date: Thu, 31 Mar 2016 20:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1458593958-25656-9-git-send-email-artemiyv@acm.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00610.txt.bz2 One little nit. As I mentioned in #0, I would just reply to this message, posting the correction. On 03/21/2016 01:59 PM, Artemiy Volkov wrote: > diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c > index d70cdd1..17fdfb2 100644 > --- a/gdb/python/py-xmethods.c > +++ b/gdb/python/py-xmethods.c > @@ -548,10 +548,10 @@ gdbpy_get_xmethod_result_type (const struct extension_language_defn *extlang, > if (!types_equal (obj_type, this_ptr)) > obj = value_cast (this_ptr, obj); > } > - else if (TYPE_CODE (obj_type) == TYPE_CODE_REF) > + else if (TYPE_IS_REFERENCE (obj_type)) > { > - struct type *this_ref = lookup_lvalue_reference_type (this_type); > - > + struct type *this_ref > + = lookup_reference_type (this_type, TYPE_CODE (obj_type)); > if (!types_equal (obj_type, this_ref)) > obj = value_cast (this_ref, obj); > } > @@ -634,10 +634,10 @@ gdbpy_invoke_xmethod (const struct extension_language_defn *extlang, > if (!types_equal (obj_type, this_ptr)) > obj = value_cast (this_ptr, obj); > } > - else if (TYPE_CODE (obj_type) == TYPE_CODE_REF) > + else if (TYPE_IS_REFERENCE (obj_type)) > { > - struct type *this_ref = lookup_lvalue_reference_type (this_type); > - > + struct type *this_ref > + = lookup_reference_type (this_type, TYPE_CODE (obj_type)); > if (!types_equal (obj_type, this_ref)) > obj = value_cast (this_ref, obj); > } Both of the above hunks need to keep the deleted whitespace. We like a blank line between the (last) variable declaration and the first line of code: else if (TYPE_IS_REFERENCE 9obj_type)) { struct type *this_ref = lookup_reference_type (this_type, TYPE_CODE (obj_type)); if (!types_equal (obj_type, this_ref)) ... } Keith