Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,  Hui Zhu <teawater@gmail.com>
Subject: Re: A question about gdb script
Date: Thu, 26 Nov 2009 08:51:00 -0000	[thread overview]
Message-ID: <200911251606.07095.pedro@codesourcery.com> (raw)
In-Reply-To: <20091125151151.GA28302@caradoc.them.org>

On Wednesday 25 November 2009 15:11:51, Daniel Jacobowitz wrote:
> > 2.  Sometime, I want just record a function, I want:
> > b functon_name
> > commands
> > silent
> > record
> > finish
> > #Maybe we can record save in this line, this is first question.
> > record stop
> > end
> > But when I really do it.  I found that gdb stop running after finish.
> > 
> > Could you help me with them?
> 
> This is a known limitation of breakpoint commands.  It's very
> difficult.

Try using the hook-stop instead.  Something like this:

 set $stop_recording_on_next_stop=0

 b functon_name
  commands
  silent
  record
  set $stop_recording_on_next_stop=1
  finish
  end

 define hook-stop
   if $stop_recording_on_next_stop 
     set $stop_recording_on_next_stop=0
     record save
     record stop
     end
   end

-- 
Pedro Alves


  reply	other threads:[~2009-11-25 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 19:19 Hui Zhu
2009-11-26  8:30 ` Daniel Jacobowitz
2009-11-26  8:51   ` Pedro Alves [this message]
2009-11-26 15:54     ` Hui Zhu
2009-11-26 17:16       ` Marc Khouzam
2009-11-27  0:32       ` Michael Snyder
2009-11-27  8:05         ` Hui Zhu
2009-11-26 15:39 ` Michael Snyder
2009-11-26 16:01   ` Hui Zhu
2009-11-27  1:37     ` Michael Snyder

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=200911251606.07095.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=teawater@gmail.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