version 0.2.39: fix of arith insts and start of re-structure
[fw/sdcc] / sim / ucsim / doc / cmd_bp.html
1 <html>
2 <head>
3 <title>Breakpoints commands of uCsim</title>
4 </head>
5
6 <body bgcolor="white">
7
8                                                           <!-- BREAKPOINTS -->
9
10 <h2>Commands of uCsim to manage breakpoints</h2>
11
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.
20
21 <p><b>Event</b> breakpoints are special onces. They cause stop of
22 execution if event specified by the breakpoint occures. Events are:
23
24 <dl><dt><b>wi</b> <dd>writing into internal RAM at specified location;
25
26 <dt><b>ri</b> <dd>reading from internal RAM at specified address;
27
28 <dt><b>wx</b> <dd>writing into external RAM at specified location
29 (MOVX instruction);
30
31 <dt><b>rx</b> <dd>reading from external RAM at specified address (MOVX
32 instruction);
33
34 <dt><b>ws</b> <dd>writing into SFR area at specified location;
35
36 <dt><b>rs</b> <dd>reading from SFR area at specified address;
37
38 <dt><b>rc</b> <dd>reading from code memory at specified location (MOVC
39 instruction).</dl>
40
41 Event breakpoint stops execution <i>after</i> specified event occured.
42
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>.
48
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.
52
53
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>
58
59
60 Set fetch or event breakpoint. The command specifies if the breakpoint
61 will be fix (<b>break</b>) or dynamic (temporary)
62 (<b>tbreak</b>).
63
64 <p>Fetch or event breakpoint can be defined. First form defines fetch
65 while second form defines event breakpoint.
66
67 <dl><dt>Fetch breakpoint
68
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
72 1 by default.
73
74 <dt>Event breakpoint
75
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>
81 operation.
82 <br>Remaining parameters are address of watched memory location and an
83 optional hit number (1 by default).
84
85 </dl>
86
87 <pre>
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
97  * 000006 ff       MOV   R7,A
98  * 000007 ff       MOV   R7,A
99  * 000008 ff       MOV   R7,A
100  * 000009 ff       MOV   R7,A
101  * 00000a ff       MOV   R7,A
102  * 00000b 02 3b e0 LJMP  3be0
103  * 00000e ff       MOV   R7,A
104  * 00000f ff       MOV   R7,A
105  * 000010 ff       MOV   R7,A
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
113 F 000160
114 > </pre>
115
116
117 <a name="clear"><h3>clear [addr...]</h3></a>
118
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.
122
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.
126
127 <pre>
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
140 > </pre>
141
142
143 <a name="delete"><h3>delete [number...]</h3></a>
144
145 Delete breakpoint(s) by its number.
146
147 <p>If parameter is not used then all breakpoints are deleted.
148
149
150 <hr>
151
152 </body>
153 </html>