From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10105 invoked by alias); 4 Jan 2007 09:42:13 -0000 Received: (qmail 10094 invoked by uid 22791); 4 Jan 2007 09:42:13 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 04 Jan 2007 09:42:06 +0000 Received: from kahikatea.snap.net.nz (p202-124-120-135.snap.net.nz [202.124.120.135]) by viper.snap.net.nz (Postfix) with ESMTP id BDDA43D824E; Thu, 4 Jan 2007 22:41:59 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 1B71A4F6CB; Thu, 4 Jan 2007 22:41:57 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17820.52196.372141.269808@kahikatea.snap.net.nz> Date: Thu, 04 Jan 2007 09:42:00 -0000 To: Daniel Jacobowitz Cc: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix variable objects for references to pointers In-Reply-To: <20070103225532.GQ17935@nevyn.them.org> References: <17792.55489.274138.854508@kahikatea.snap.net.nz> <17793.7666.771432.41360@kahikatea.snap.net.nz> <20070103225532.GQ17935@nevyn.them.org> X-Mailer: VM 7.19 under Emacs 22.0.92.5 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/msg00111.txt.bz2 > > + 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. Something like below? set end_of_proc [gdb_get_line_number "return 99;"] send_gdb "-break-insert $end_of_proc\n" mi_continue_to ".*" reference_to_pointer "" ".*${srcfile}" $end_of_proc \ "continue to return 99" Other tests seem to use mi_gdb_test for -break-insert but I'm not interested in the result and mi_continue presumably sifts through the output until it reaches something it recognises. I'm also not that interested in the breakpoint number so I've used a wildcard for future-proofing. -- Nick http://www.inet.net.nz/~nickrob