102
Triggering Examples
Single-Machine Trigger Examples
To trigger on the nth recursive call of a recursive function
1Go to the state analyzers Trigger menu.
2Define the terms CALL_ADD, F_START, and F_END to
represent the called address of the recursive function, and the
start and end addresses of the function. Define F_EXIT to
represent the address of the first program statement executed
after the original recursive call has terminated.
Typically, CALL_ADD is the address of the code that sets up the
activation record on the stack, F_START is the address of the first
statement in the function, and F_END is the address of the last
instruction of the function, which does not necessarily correspond to
the address of the last statement. If the start of the function and the
address called by recursive calls are the same, or you are not interested
in the function initialization code, you can use F_START for both
CALL_ADD and F_START.
3Change State Sequence Level 1s function to "Find event2 n
times after event1 before event3 occurs."
4In the pop-up, enter the following sequence specification:
While storing anystate Find "CALL_ADD" "9" times a fter "F_START" before
"F_EXIT" occurs.
You should use your value for n-1 instead of "9" in the specification.