Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Jim Ingham <jingham@apple.com>
Cc: Vladimir Prus <ghost@cs.msu.su>, gdb@sources.redhat.com
Subject: Re: 'continue' command problem
Date: Wed, 27 Jun 2007 00:12:00 -0000	[thread overview]
Message-ID: <18049.43846.774921.460635@kahikatea.snap.net.nz> (raw)
In-Reply-To: <81922B5F-74B3-4CCF-A690-FA58B50C94D6@apple.com>

 > 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


  reply	other threads:[~2007-06-27  0:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200706041421.21962.leonp@plris.com>
2007-06-25  7:02 ` Vladimir Prus
2007-06-25  7:51   ` Nick Roberts
2007-06-25 18:04   ` Jim Ingham
2007-06-26  4:40     ` Nick Roberts
2007-06-26 18:16       ` Jim Ingham
2007-06-27  0:12         ` Nick Roberts [this message]
2007-06-26  7:13     ` Vladimir Prus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18049.43846.774921.460635@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    --cc=jingham@apple.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox