3 <title>Breakpoints commands of uCsim</title>
10 <h2>Commands of uCsim to manage breakpoints</h2>
12 Two kind of breakpoints can be used: fetch and event
13 breakpoint. <B>Fetch</b> breakpoints are classical breakpoints. They
14 can be placed at any instruction in the code memory. Breakpoint will
15 be hit if CPU fetches instruction code from the memory location
16 specified by the breakpoint. Only fetching of first byte of the
17 instruction hits the breakpoint. If the execution reaches a breakpoint
18 it stops <i>before</i> the instruction at location specified by the
19 breakpoint would be executed.
21 <p><b>Event</b> breakpoints are special onces. They cause stop of
22 execution if event specified by the breakpoint occures. Events are:
24 <dl><dt><b>wi</b> <dd>writing into internal RAM at specified location;
26 <dt><b>ri</b> <dd>reading from internal RAM at specified address;
28 <dt><b>wx</b> <dd>writing into external RAM at specified location
31 <dt><b>rx</b> <dd>reading from external RAM at specified address (MOVX
34 <dt><b>ws</b> <dd>writing into SFR area at specified location;
36 <dt><b>rs</b> <dd>reading from SFR area at specified address;
38 <dt><b>rc</b> <dd>reading from code memory at specified location (MOVC
41 Event breakpoint stops execution <i>after</i> specified event occured.
43 <p>Every breakpoint can be <b>fix</b> (permanent) or <b>dynamic</b>
44 (temporary). Dynamic breakpoints are automatically removed when they
45 reached. Some commands place dynamic fetch breakpoints into the code,
46 for example <a href="#g"><b>go</b></a> or <a
47 href="#n"><b>next</b></a>.
49 <p>A <b>hit number</b> can be associated to any breakpoint. This hit
50 number specifies how many times the breakpoint must be hit before it
51 causes the execution to stop. This hit number is 1 by default.
54 <a name="break"><h3>break addr [hit]
55 <br>break memory_type r|w addr [hit]</h3></a>
56 <a name="tbreak"><h3>tbreak addr [hit]
57 <br>tbreak memory_type r|w addr [hit]</h3></a>
60 Set fetch or event breakpoint. The command specifies if the breakpoint
61 will be fix (<b>break</b>) or dynamic (temporary)
64 <p>Fetch or event breakpoint can be defined. First form defines fetch
65 while second form defines event breakpoint.
67 <dl><dt>Fetch breakpoint
69 <dd>First parameter specifies address where the breakpoint must be
70 placed to. It should be address of an instruction.
71 <br>Second parameter is optional and it specifies the hit number. It is
76 <dd>First parameter specifies class name of memory where we are going
77 to watch for en event. Class names of memories can be checked by q<a
78 href="cmd_general.html#conf">conf</a> command.
79 <br>Second parameter specifies the event. It can be <b>r</b> to
80 specify <b>read</b> operation or <b>w</b> which means <b>write</b>
82 <br>Remaining parameters are address of watched memory location and an
83 optional hit number (1 by default).
88 $ <font color="#118811">s51 remoansi.hex</font>
89 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
90 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
91 This is free software, and you are welcome to redistribute it
92 under certain conditions; type `show c' for details.
93 58659 bytes read from remoansi.hex
94 > <font color="#118811">dc 0 0x10</font>
95 000000 02 01 60 LJMP 0160
96 * 000003 02 00 3c LJMP 003c
102 * 00000b 02 3b e0 LJMP 3be0
106 > <font color="#118811">break 0x160</font>
107 Breakpoint 1 at 0x000160: CLR P1.0
108 > <font color="#118811">tbreak 8 2</font>
109 Breakpoint 2 at 0x000008: MOV R7,A
110 > <font color="#118811">g</font>
111 Simulation started, PC=0x000000
112 Stop at 000160: (4) Breakpoint
117 <a name="clear"><h3>clear [addr...]</h3></a>
119 Delete fetch breakpoint. Parameter specifies address of breakpoint. If
120 there is no breakpoint specified at given address this command prints
121 out a warning message.
123 <p>If parameter is not given then breakpoint at current PC will be
124 deleted if it exists. If more than one address is specified then all
125 breakpoints at specified addresses will be deleted.
128 > <font color="#118811">i b</font>
129 Num Type Disp Hit Cnt Address What
130 1 fetch keep 1 1 0x000160 CLR P1.0
131 2 fetch del 1 1 0x000180 LJMP 022a
132 1 event keep 1 1 0x000006 wi
133 > <font color="#118811">clear 160</font>
134 No breakpoint at 0000a0
135 > <font color="#118811">clear 0x160</font>
136 > <font color="#118811">i b</font>
137 Num Type Disp Hit Cnt Address What
138 2 fetch del 1 1 0x000180 LJMP 022a
139 1 event keep 1 1 0x000006 wi
143 <a name="delete"><h3>delete [number...]</h3></a>
145 Delete breakpoint(s) by its number.
147 <p>If parameter is not used then all breakpoints are deleted.