Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: cbuser2 on November 20, 2012, 12:45:55 pm

Title: [solved] how to set a loop counter for debugging?
Post by: cbuser2 on November 20, 2012, 12:45:55 pm
Hi all.

If I have a loop, how can I set a counter to process the loop X times? I don't want to manually step through the loop X times. VC++ has an option for this, so does CB also have this option? It is a very convenient way to check the values of variables after a loop has done X times iterations.

EDIT: Basically what I want to do is to set a breakpoint in(or outside) a loop with the condition that the program breaks after X iterations of the loop.

Thanks in advance.
Title: Re: how to set a loop counter for debugging?
Post by: Martin K. on November 20, 2012, 12:51:12 pm
edit breakpoint, Ignore count before break

Martin
Title: Re: how to set a loop counter for debugging?
Post by: cbuser2 on November 20, 2012, 12:53:50 pm
edit breakpoint, Ignore count before break

Thanks. :D
Title: Re: how to set a loop counter for debugging?
Post by: ollydbg on November 20, 2012, 12:55:00 pm
See this image:
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2012-11-20195513.png)
Also, you can see this manual about conditional breakpoint: http://www.delorie.com/gnu/docs/gdb/gdb_34.html
Title: Re: [solved] how make the program break after X iterations of a loop?
Post by: cbuser2 on November 20, 2012, 12:56:14 pm
Thanks ollydbg! :)