From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13930 invoked by alias); 11 Oct 2012 22:10:50 -0000 Received: (qmail 13912 invoked by uid 22791); 11 Oct 2012 22:10:48 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Oct 2012 22:10:43 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TMQxl-0004v9-23 from Luis_Gustavo@mentor.com ; Thu, 11 Oct 2012 15:10:41 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by svr-orw-fem-01.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 11 Oct 2012 15:10:40 -0700 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 11 Oct 2012 15:10:40 -0700 Message-ID: <507743DF.1020907@codesourcery.com> Date: Thu, 11 Oct 2012 22:10:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: Sergio Durigan Junior CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix mi "-var-create" regression References: <5075D4FD.9050900@mentor.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00187.txt.bz2 On 10/11/2012 06:53 PM, Sergio Durigan Junior wrote: > On Wednesday, October 10 2012, Luis Gustavo wrote: > >> Hi, > > Hey Luis :-) Hey! > 1) I believe you could remove some of the parentheses in the `if' > above. Something like: > > 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) > > would have the same effect, right? Ah, of course. Thanks for noticing that. > > 2) Would it be possible to provide a testcase for this issue? Not sure > if it's really needed, but I guess it won't hurt :-). Of course, if > some maintainer thinks it's useless, then please disconsider the idea > right away. I thought about this for a while, and the best testing mechanism seems to be just turning the "print object" option on by default and running the entire testsuite, otherwise this test will be very specific to the -var-create mechanism. value_actual_type is called from 3 different places IIRC. If we're thinking about a regression coverage test, then i agree that a test is appropriate in this case, so we can be sure it will never happen again. Luis