This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
[NEWBIE] How to exit from a loop
- From: Stefano Sabatini <stefano dot sabatini-lala at poste dot it>
- To: gdb Mailing List <gdb at sources dot redhat dot com>
- Date: Mon, 30 Jun 2008 17:33:11 +0200
- Subject: [NEWBIE] How to exit from a loop
Hi all,
suppose I'm debugging some code like this:
int i;
for (i=0; i < a_big_number; i++)
do_something(i);
out_of_the_loop:
do_something_else();
and I'd like to jump out of the loop.
What I did everytime is to simply put a breakpoint just after
out_of_the_loop and hit continue, then I need to unset the breakpoint.
I wonder if there is a more efficient way to exit from the loop,
without the need to set a breakpoint at the rigth place, continue and
then unset the breakpoint but with just a single command/macro.
Many thanks in advance, regards.