3

I have to check by way of a script if a program stops at a breakpoint: example:

break.set func1 /Program

Go

IF (program stops at breakpoint) ( do smth )

I am new to this language and I cannot seem to find relevant information on google. Thank you

dev15
  • 665
  • 3
  • 14
sandra
  • 65
  • 4

2 Answers2

1

If you don't know whether the program stops at the program you need to wait a certain (defined by you) amount of time and then check the run-state of the processor, and if stopped then check whether the PC is at your symbol.

; set breakpoint
Break.Set func1 /Program

; start processor
Go

; wait until processor stopped or 5 seconds elasped
WAIT !STATE.RUN() 5.0s

IF STATE.RUN()
(
    PRINT %ERROR "Processor still running!"
    ENDDO
)

; check PC
IF R(PC)!=sYmbol.BEGIN(func1)
(
    PRINT %ERROR "Processor stopped but wrong PC!"
    ENDDO
)

PRINT "Test passed!"

ENDDO
dev15
  • 665
  • 3
  • 14
0

If you actual goal is to execute a script when a breakpoint gets hit, I recommend to used the option /CMD of the Break.Set. E.g.:

Break.Set  func1 /Program /CMD "DO smth.cmm" 
Holger
  • 3,920
  • 1
  • 13
  • 35