From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5318 invoked by alias); 27 Jun 2007 00:12:10 -0000 Received: (qmail 5309 invoked by uid 22791); 27 Jun 2007 00:12:09 -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; Wed, 27 Jun 2007 00:12:06 +0000 Received: from kahikatea.snap.net.nz (249.63.255.123.dynamic.snap.net.nz [123.255.63.249]) by viper.snap.net.nz (Postfix) with ESMTP id CB46E3D9D25; Wed, 27 Jun 2007 12:12:02 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id A74F98FBF6; Wed, 27 Jun 2007 12:11:51 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18049.43846.774921.460635@kahikatea.snap.net.nz> Date: Wed, 27 Jun 2007 00:12:00 -0000 To: Jim Ingham Cc: Vladimir Prus , gdb@sources.redhat.com Subject: Re: 'continue' command problem In-Reply-To: <81922B5F-74B3-4CCF-A690-FA58B50C94D6@apple.com> References: <200706041421.21962.leonp@plris.com> <200706251101.54544.ghost@cs.msu.su> <18048.39066.783422.293969@kahikatea.snap.net.nz> <81922B5F-74B3-4CCF-A690-FA58B50C94D6@apple.com> X-Mailer: VM 7.19 under Emacs 22.1.50.7 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00327.txt.bz2 > Ah, sorry, I just called the field "commands". It's done in > breakpoint.c, in "print_it_typical" (in the Apple sources). OK, thanks for the info. > The way I implemented it, I added a *started message to tell the UI > that we had restarted because of a breakpoint command, as well as a > ^continuing. I forget exactly why I chose to do it this way, it's > maybe a little overdetermined. (Note, we also added a -breakpoint- > commands" command to set the breakpoint commands...) > > Anyway, this looks like: >... > (gdb) break 8 > Breakpoint 1 at 0x1fa1: file main.c, line 8. > (gdb) commands 1 > Type commands for when breakpoint 1 is hit, one per line. > End with a line saying just "end". > >print foo > >continue > >end > (gdb) set interpreter mi1 > -exec-run > ~"[Switching to process 19582 local thread 0x1103]\n" > =shlibs-updated > ^running > (gdb) > ~"$1 = 0" > ~"\n" > ~"Continuing.\n" > ^continuing > *started,reason="breakpoint-command" "breakpoint-command" comes before the first "breakpoint-hit" ? > *stopped > ,time > = > {wallclock > = > "0.00153 > ",user > = > "0.00046 > ",system > = > "0.00098 > ",start > ="1182881550.648028",end="1182881550.649559"},reason="breakpoint- > hit",commands="yes",times="2",bkptno="1",thread-id="1" > ~"$2 = 1" > ~"\n" > ~"Continuing.\n" > ^continuing >... If Apple GDB can handle command lists, I guess user defined functions work too. Isn't asynchronous operation a problem here because the second command can start executing before the first command has finished? -- Nick http://www.inet.net.nz/~nickrob