'continue' command problem

Jim Ingham jingham@apple.com
Tue Jun 26 18:16:00 GMT 2007


Ah, sorry, I just called the field "commands".  It's done in  
breakpoint.c, in "print_it_typical" (in the Apple sources).

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:

gdbrulez:/tmp > gdb a.out
GNU gdb 6.3.50-20050815 (Apple version gdb-688) (Sat Jun 16 20:20:22  
UTC 2007)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for  
shared libraries ... done

(gdb) list main
1	int
2	main ()
3	{
4	  int foo = 0;
5	
6	  while (foo < 100)
7	    {
8	      foo++;
9	    }
10	
(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"
*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
*started,reason="breakpoint-command"
*stopped 
,time 
= 
{wallclock 
= 
"0.00101 
",user 
= 
"0.00034 
",system 
= 
"0.00071 
",start 
="1182881550.649577",end="1182881550.650586"},reason="breakpoint- 
hit",commands="yes",times="3",bkptno="1",thread-id="1"
~"$3 = 2"
~"\n"
~"Continuing.\n"
^continuing

Jim

On Jun 25, 2007, at 9:39 PM, Nick Roberts wrote:

> Jim Ingham writes:
>> At Apple, we also added a "breakpoint-commands" output field to the
>> "*stopped - breakpoint-hit" message.
>
> I can see an MI command -break-commands but no output field,
> "breakpoint-commands".  Which file is it in?
>
>
> -- 
> Nick                                           http://www.inet.net.nz/~nickrob



More information about the Gdb mailing list