This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]