From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22674 invoked by alias); 3 Jan 2013 12:30:54 -0000 Received: (qmail 22665 invoked by uid 22791); 3 Jan 2013 12:30:53 -0000 X-SWARE-Spam-Status: No, hits=-4.7 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, 03 Jan 2013 12:30:45 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TqjwW-0005nA-OW from Luis_Gustavo@mentor.com ; Thu, 03 Jan 2013 04:30:40 -0800 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, 3 Jan 2013 04:30:40 -0800 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Jan 2013 04:30:39 -0800 Message-ID: <50E579E4.30205@codesourcery.com> Date: Thu, 03 Jan 2013 12:30: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: Joel Brobecker CC: Andreas Schwab , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix mi "-var-create" regression References: <20121014171805.GB3050@adacore.com> <507BFF97.2000900@codesourcery.com> <87y5j4ziof.fsf@fleche.redhat.com> <508DB53E.30507@codesourcery.com> <20121129210737.GM3581@adacore.com> <50B81642.9020705@codesourcery.com> <20121207024813.GD31477@adacore.com> <50C159A3.4020507@codesourcery.com> <50DAEE08.8010200@codesourcery.com> <20130103034602.GA3863@adacore.com> In-Reply-To: <20130103034602.GA3863@adacore.com> Content-Type: multipart/mixed; boundary="------------040805020403050108010707" 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: 2013-01/txt/msg00034.txt.bz2 This is a multi-part message in MIME format. --------------040805020403050108010707 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 391 On 01/03/2013 01:46 AM, Joel Brobecker wrote: >> This patch addresses the problem Andreas saw by creating a variable >> of type (void *). This way we are guaranteed to have the type we >> need to reproduce the problem. > > I don't see a problem with that. But can you add a comment explaining > why you are casting the register to void *? Yes, of course. How does this comment look? Luis --------------040805020403050108010707 Content-Type: text/x-patch; name="var_create_rtti.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="var_create_rtti.diff" Content-length: 1103 diff --git a/ChangeLog b/ChangeLog index a5a47ca..aa180a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-03 Luis Machado + + * gdb.mi/mi-var-create-rtti.exp: Create a variable of + type void *. + 2012-12-20 Jan-Benedict Glaw * Makefile.def (install-target-libgo): Depend on diff --git a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp index da3cf1b..f991951 100644 --- a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp +++ b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp @@ -45,8 +45,10 @@ if ![mi_run_to_main] { # Enable "print object" mi_gdb_test "-gdb-set print object on" ".*" -# Test creating a variable for $sp -mi_gdb_test "-var-create sp1 * \$sp" \ +# Test creating a variable for $sp. +# We use a explicit cast to (void *) as that is the +# type that caused the bug this testcase is testing for. +mi_gdb_test "-var-create sp1 * ((void*)\$sp)" \ "\\^done,name=\"sp1\",numchild=\"0\",value=\"$hex\",type=\"void \\*\",has_more=\"0\"" \ "-var-create sp1 * \$sp" gdb_exit --------------040805020403050108010707--