Information Technology Reference
In-Depth Information
The breakpoint is ignored the first five times the code runs through the loop, and it isn't triggered until the
sixth repeat. This option is ideal for simple delayed breakpoints where you know in advance how many
times a loop or method will be executed.
Figure 15.18
Creating a delayed conditional breakpoint
You can create a similar result by resetting the ignore count to zero and entering i == 5 into the Condition box.
In this simple example, this creates exactly the same outcome. But the Condition box is far more flexible. You
can reference any variable that is in scope and use any valid code as a conditional.
For example, if you replace i == 5 with aNotification , the breakpoint is triggered whenever aNoti-
fication is non-zero. In this example, the condition is always true. In a more complex application, aNoti-
fication might follow some other feature or event. You can use this feature to add intelligence to your de-
bugging, creating conditions that reference values in distant but related objects.
Triggering actions at breakpoints
The Actions feature is one of the more powerful options in the debugger. You can use it to trigger almost any
event at a breakpoint. For example, you can:
Run an AppleScript
Send the debugger a text command
Log a message to the console or speak it as text
Run a UNIX shell command
Search WWH ::




Custom Search