From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29256 invoked by alias); 3 Jan 2007 22:55:41 -0000 Received: (qmail 29247 invoked by uid 22791); 3 Jan 2007 22:55:41 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 03 Jan 2007 22:55:36 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1H2F1A-0007C2-HF; Wed, 03 Jan 2007 17:55:32 -0500 Date: Wed, 03 Jan 2007 22:55:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix variable objects for references to pointers Message-ID: <20070103225532.GQ17935@nevyn.them.org> Mail-Followup-To: Nick Roberts , Vladimir Prus , gdb-patches@sources.redhat.com References: <17792.55489.274138.854508@kahikatea.snap.net.nz> <17793.7666.771432.41360@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17793.7666.771432.41360@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2007-01/txt/msg00092.txt.bz2 On Thu, Dec 14, 2006 at 10:48:34PM +1300, Nick Roberts wrote: > + mi_runto reference_to_pointer > + > + set end_of_proc [gdb_get_line_number "return 99;"] > + send_gdb "-exec-next 4\n" > + gdb_expect { > + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"reference_to_pointer\",args=\\\[\\\],file=\".*${srcfile}\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$end_of_proc\"\}\r\n$mi_gdb_prompt$" { > + pass "4xnext to return 99" > + } > + timeout { fail "4xnext in reference_to_pointer (timeout)" } > + } Using send_gdb / gdb_expect this way is a problem. If anything goes wrong, then the test will sit until it times out. There's only one pattern, so you could use mi_gdb_test. "-exec-next 4" isn't great either; compiler changes or test changes can easily make you end up somewhere unexpected. This line isn't testing anything you're interested in, right? Then you can just put a breakpoint in the right place and run to that breakpoint. I'd recommend mi_continue_to. I don't see a convenient helper in mi-support.exp to set the breakpoint, but there's an example in mi-var-cmd.exp. (Hardcoding the breakpoint number that way isn't great either but I'll clean that up another day.) -- Daniel Jacobowitz CodeSourcery