Debugger: any way to breakpoint after several loop iterations?
-
Yes, most debuggers support this. Check the documentation of your preferred debugger.
-
Just enter it into the top left area of the debugger mode (not 100% sure that is the right area, I have reordered stuff in my debug mode:-). You can interact with gdb normally there. Ctrl-Return will pass the command on to the debugger.
Of course you could also use the "condition" field in the breakpoint configuration window (Right click on the breakpoint and choose "edit breakpoint" or something, sorry, I have no creator handy right now to look up the exact terms).
-
I like the second suggestion much better. There's also an "ignore count" that I can use to do the same thing, more or less.
What is the format for a valid condition? I tried "i < 10" (i is the index of the loop where the break is) but it doesn't stop.
Thanks.
-
No idea, I never used it:-) My guess is that it is passed directly to GDB, so it should be in whichever format GDB expects the condition.
If you have questions on the debugger you better ask on the Qt Creator mailing list: The guys doing the debugger do hang out there but only very rarely read this forum.
-
Hey, Tobias -
I've obviated the original problem for now, but I'd like to know more about this:
Just enter it into the top left area of the debugger mode (not 100% sure that is the right area, I have reordered stuff in my debug mode:-). You can interact with gdb normally there. Ctrl-Return will pass the command on to the debugger.
My debugger window doesn't show any place for entering something to pass to the debugger. Can you tell me where this "lives?"
Thanks.
-
The "debugger log" has the input area: It is the left one of the two text areas the log contains. It has a line edit labeled "Command".
Press Ctrl-Enter to actually send the input on to the debugger.
-
Hmm...OK, all I have is two bare text areas. No labels, nothing in them except text that appears to be going to/coming from the debugger. The left area seems to contain commands, preceded by numbers, like this:
bq. 1show version
2set print static-members off
3set breakpoint pending on
4set print elements 10000
5set overload-resolution off
6handle SIGSEGV nopass stop print
7set unwindonsignal on
8set width 0
9set height 0
10-interpreter-exec console "maintenance set internal-warning quit no"But, typing in there and hitting ctrl-enter doesn't seem to do anything.
Come to think of it, I'm not sure where the commands in the left area are coming from.
-
If anyone can help me figure out where the debugger input area is, I'd appreciate it. Here's a picture of my Qt window in debugging mode:
!http://www.scopedin.com/images/qt.jpg(Qt window)!
-
Hmmm... my creator has a input line beneath the top left of the aceas (the one with the 36-gdb-exit) to input commands in. IIRC that was added to make it more discoverable that you can actually send commands to the debugger which used to work before IIRC.
Try typing into the top-left area and hitting Ctrl-Return.
-
"google helps":http://www.lmgtfy.com/?q=gdb+manual...