From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27535 invoked by alias); 14 Oct 2012 17:18:13 -0000 Received: (qmail 27525 invoked by uid 22791); 14 Oct 2012 17:18:12 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 14 Oct 2012 17:18:08 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5D1421C7892; Sun, 14 Oct 2012 13:18:08 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HHNXmJF3NdYC; Sun, 14 Oct 2012 13:18:08 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2BC131C7890; Sun, 14 Oct 2012 13:18:08 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 9C908C7D0C; Sun, 14 Oct 2012 10:18:05 -0700 (PDT) Date: Sun, 14 Oct 2012 17:18:00 -0000 From: Joel Brobecker To: Luis Gustavo Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix mi "-var-create" regression Message-ID: <20121014171805.GB3050@adacore.com> References: <5075D4FD.9050900@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5075D4FD.9050900@mentor.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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-10/txt/msg00206.txt.bz2 Hi Luis, > 2012-10-10 Luis Machado > > * value.c (value_actual_type): Check for TYPE_CODE_VOID > target types. I don't feel entirely comfortable approving this patch, not because I think it's iffy, but just because I don't have a good knowledge of what is going on for you (RTTI is C++, and I don't follow C++ support). If no one else has the time to officially review your patch within the next week or so, I will take a deeper look. It does look reasonable. I did notice a couple of things (besides the unnecessary parens): > - if (TYPE_CODE (result) == TYPE_CODE_PTR > + /* If result's target type is TYPE_CODE_VOID, do not try fetching its rtti > + type. GDB will try to dereference the void pointer and will throw an > + error when trying to do so. */ Can you reformat the comment to fit within 70 characters. That's the soft line limit... > + if ((TYPE_CODE (result) == TYPE_CODE_PTR > || TYPE_CODE (result) == TYPE_CODE_REF) > + && ((TYPE_TARGET_TYPE (result) != NULL) > + && TYPE_CODE (TYPE_TARGET_TYPE (result)) != TYPE_CODE_VOID)) I don't think that you need to test for the TYPE_TARGET_TYPE, since you already know that it's either a PTR or REF type, which always have a TARGET_TYPE. -- Joel