Reputation: 315
I am running a Practice script inside Trace32. I have noticed that if for example I have this set of commands
Go
Step.Over
Step.Over
doesn't necessarily wait for Go
to finish execution to start. How to tell Trace32 not to execute a command until the other one finished. I have tried inserting Wait 2.s
after each command. However, since I don't know how long the command will take that doesn't work in every run.
Upvotes: 1
Views: 668
Reputation: 566
I assume that with "wait for Go
to finish execution" you mean to wait until the processor hits a breakpoint. The Go
command however does not wait until a breakpoint is reached. The execution of the Go command is completed as soon as the processor has been started.
Use the command WAIT <event> [<timeout>]
to make the script wait for the breakpoint. The timeout is optional, but highly recommended for script robustness.
; start execution
Go
;wait until processor halts at breakpoint (timeout: 2 seconds)
WAIT !STATE.RUN() 2s
;error handler
IF STATE.RUN()
(
PRINT %ERROR "Breakpoint not reached!"
ENDDO
)
;continue stepping
Step.Over
Upvotes: 3