From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11223 invoked by alias); 26 Dec 2012 12:31:19 -0000 Received: (qmail 11209 invoked by uid 22791); 26 Dec 2012 12:31:17 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MISSING_HEADERS,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; Wed, 26 Dec 2012 12:31:11 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Tnq8X-0005Eq-Uf from Luis_Gustavo@mentor.com ; Wed, 26 Dec 2012 04:31:05 -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); Wed, 26 Dec 2012 04:31:05 -0800 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Dec 2012 04:31:05 -0800 Message-ID: <50DAEE08.8010200@codesourcery.com> Date: Wed, 26 Dec 2012 12:31: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 CC: Joel Brobecker , Andreas Schwab , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix mi "-var-create" regression References: <5075D4FD.9050900@mentor.com> <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> In-Reply-To: <50C159A3.4020507@codesourcery.com> Content-Type: multipart/mixed; boundary="------------010702030107080109080509" 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-12/txt/msg00816.txt.bz2 This is a multi-part message in MIME format. --------------010702030107080109080509 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 813 Hi, On 12/07/2012 12:51 AM, Luis Machado wrote: > On 12/07/2012 12:48 AM, Joel Brobecker wrote: >> And do you absolutely need the register to be of type (void *) >> for the test to exercise the original problem? I don't know if >> we can find any that's guaranteed to be of any type. So you might >> have to use different register names depending on the target. >> > > Yeah. I may need to do something different here. I didn't forget about > this one though. > > Luis Casting seems to be the most sensible solution to this problem. 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 thought about replacing SP with PC, but SP is probably available for all targets. What do you think? Luis --------------010702030107080109080509 Content-Type: text/x-patch; name="var_create_rtti.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="var_create_rtti.diff" Content-length: 985 diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4620c2e..9ffd991 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-12-26 Luis Machado + + * gdb.mi/mi-var-create-rtti.exp: Create a variable of + type void *. + 2012-12-25 Jan Kratochvil * gdb.mi/mi-fullname-deleted.exp: New file. diff --git a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp index 16d8551..d6697de 100644 --- a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp +++ b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp @@ -46,7 +46,7 @@ if ![mi_run_to_main] { mi_gdb_test "-gdb-set print object on" ".*" # Test creating a variable for $sp -mi_gdb_test "-var-create sp1 * \$sp" \ +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 --------------010702030107080109080509--