This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Breakpoint commands
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb at sourceware dot org, Eli Zaretskii <eliz at gnu dot org>
- Date: Sat, 24 Oct 2009 17:03:59 +0100
- Subject: Re: Breakpoint commands
- References: <83iqe4g9t2.fsf@gnu.org>
A Saturday 24 October 2009 15:12:41, Eli Zaretskii escreveu:
> Some commands seem to be not working inside breakpoint commands, in
> the sense that breakpoint commands after them are not executed.
>
> Two examples that I tried were `finish' and `until'. What I wanted
> was to stop at function entry, print some variable, then let the
> function run to completion, and print some other (global) variable
> that gets modified by this function. The breakpoint commands
> therefore were something like
>
> break FOO
> commands
> >print BAR
> >finish
> >print BAZ
> >end
>
> and similarly with `until' instead of `finish'; I used the last line
> of the function's body for its argument.
>
> What I see is that the second `print' is never executed. Sounds like
> a bug to me. Or did I miss something?
>
From gdb.texinfo:'Break Commands':
"You can use breakpoint commands to start your program up again. Simply
use the @code{continue} command, or @code{step}, or any other command
that resumes execution.
Any other commands in the command list, after a command that resumes
execution, are ignored. This is because any time you resume execution
(even with a simple @code{next} or @code{step}), you may encounter
another breakpoint---which could have its own command list, leading to
ambiguities about which list to execute."
--
Pedro Alves