Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: black iris on August 20, 2012, 08:51:39 am

Title: debuging loops in CB
Post by: black iris on August 20, 2012, 08:51:39 am
can i start debuging after n iteration of the loop?
 ??? ???
Title: Re: debuging loops in CB
Post by: chice on August 20, 2012, 09:09:21 am
a method that applies to all conditions:

for(int i = 0; i < 10000; i++)
{
     if( i == 100)
     {
          int _tmp = 1; // set breakpoint here, or use DebugBreak in Windows
     }
}
Title: Re: debuging loops in CB
Post by: Jenna on August 20, 2012, 05:02:34 pm
can i start debuging after n iteration of the loop?
 ??? ???

Yes, just create a breakpoint, right-click on it and chose edit breakpoint.
Now you can set a break condition like loop-variable >= n or chose "Ignore count before break" and set it to n .
Title: Re: debuging loops in CB
Post by: black iris on August 20, 2012, 09:15:21 pm
thanks, both solutions were helpful