Event breakpoints are special ones. They cause stop of execution if event specified by the breakpoint occurs. Event can be a read or a write operation on any address space location. An event breakpoint stops execution after specified event occurred.
Every breakpoint can be fix (permanent) or dynamic (temporary). Dynamic breakpoints are automatically removed when they reached. Some commands place dynamic fetch breakpoints into the code, for example go or next.
A hit count can be associated to any breakpoint. This hit number specifies how many times the breakpoint must be hit before it causes the execution to stop. This hit number is 1 by default.
Fetch or event breakpoint can be defined. First form defines fetch while second form defines event breakpoint.
$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> load "remo.hex" Loading from remo.hex 55755 words read from remo.hex 0> dc 0 0x10 0x0000 02 01 60 LJMP 0x0160 0x0003 02 00 3c LJMP 0x003c 0x0006 ff MOV R7,A 0x0007 ff MOV R7,A 0x0008 ff MOV R7,A 0x0009 ff MOV R7,A 0x000a ff MOV R7,A 0x000b 02 2f 74 LJMP 0x2f74 0x000e ff MOV R7,A 0x000f ff MOV R7,A 0x0010 ff MOV R7,A 0> break 0x160 Breakpoint 1 at 0x000160 (cond="") 0x0160 F c2 90 CLR 0x900x90 <P1>.0 0> tbreak 8 2 Breakpoint 2 at 0x000008 (cond="") 0x0008 D ff MOV R7,A 0> run Simulation started, PC=0x000000 Stop at 0x000160: (104) Breakpoint R0 R1 R2 R3 R4 R5 R6 R7 41 58 fc c9 8b bc 95 6b @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x07 -> 6b 95 bc 8b c9 fc 58 41 DPTR= 0x0000 @DPTR= 0x83 131 . 0x0160 F c2 90 CLR 0x900x90 <P1>.0 F 0x000160 Simulated 24 ticks (2.170e-06 sec) Host usage: 0.000003 sec, rate=0.700171 0>Breakpoint hits can be made more noticeable by printing a beep character on the console. This function can be turned on by setting the option beep_break (FALSE by default).
If parameter is not given then breakpoint at current PC will be deleted if it exists. If more than one address is specified then all breakpoints at specified addresses will be deleted.
$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> load "remo.hex" Loading from remo.hex 55755 words read from remo.hex 0> break 0x160 Breakpoint 1 at 0x000160 (cond="") 0x0160 F c2 90 CLR 0x900x90 <P1>.0 0> tbreak 8 2 Breakpoint 2 at 0x000008 (cond="") 0x0008 D ff MOV R7,A 0> info break Num Type Disp Hit Cnt Address Cond 1 fetch keep 1 1 0x000160 true 2 fetch del 2 2 0x000008 true 0> clear 160 No breakpoint at 0x0000a0 0> clear 0x160 0> i b Num Type Disp Hit Cnt Address Cond 2 fetch del 2 2 0x000008 true 0>
If parameter is not used then all breakpoints are deleted.
Attach a script to a breakpoint. Breakpoint number can be omitted if only one breakpoint exists. Breakpoint numbers can be checked by info breakpoint command. The script is a command or a list of commands separated by a semicolon (;) character. It will be executed when the specified breakpoint is accepted. Whether the text of the script is printed before execution is controlled by the option echo_script, which is FALSE by default. See set option command how to set it. If script is not used, breakpoint command will be deleted from the specified breakpoint.
/format option can be used to specify print format for the expression. For meaning of the options, see expression command.
If no expr argument is given, all defined expressions are listed and evaluated and values are printed.
$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> load "remo.hex" Loading from remo.hex 55755 words read from remo.hex 0> disp R7 0> disp ACC 0> break 0x9f9 Breakpoint 1 at 0x0009f9 (cond="") 0x09f9 F c2 a9 CLR 0xa90xa8 <IE>.1 0> display 1: R7 = 107 2: ACC = 0 0> run Simulation started, PC=0x000000 Stop at 0x0009f9: (104) Breakpoint R0 R1 R2 R3 R4 R5 R6 R7 41 04 fc c9 8b bc 00 00 @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 8b . PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x24 -> 01 77 1d 84 43 31 94 d0 DPTR= 0x0000 @DPTR= 0x83 131 . 0x09f9 F c2 a9 CLR 0xa90xa8 <IE>.1 F 0x0009f9 Simulated 180 ticks (1.628e-05 sec) Host usage: 0.000010 sec, rate=1.625397 1: R7 = 0 2: ACC = 0 0>