Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / doc / cmd_bp.html
1 <html>
2 <head>
3 <title>Breakpoints commands of &micro;Csim</title>
4 </head>
5
6 <body bgcolor="white">
7
8                                                           <!-- BREAKPOINTS -->
9
10 <h2>Commands of &micro;Csim to manage breakpoints</h2>
11
12 Two kind of breakpoint 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. Event can be a
23 read or a write operation on any address space location. Event
24 breakpoint stops execution <i>after</i> specified event occured.
25
26 <p>Every breakpoint can be <b>fix</b> (permanent) or <b>dynamic</b>
27 (temporary). Dynamic breakpoints are automatically removed when they
28 reached. Some commands place dynamic fetch breakpoints into the code,
29 for example <a href="#g"><b>go</b></a> or <a
30 href="#n"><b>next</b></a>.
31
32 <p>A <b>hit number</b> can be associated to any breakpoint. This hit
33 number specifies how many times the breakpoint must be hit before it
34 causes the execution to stop. This hit number is 1 by default.
35
36 <hr>
37
38
39 <a name="break"><h3>break <i>addr [hit]</i>
40 <br>break <i>memory_type r|w addr [hit]</i></h3></a>
41 <a name="tbreak"><h3>tbreak<i> addr [hit]</i>
42 <br>tbreak <i>memory_type r|w addr [hit]</i></h3></a>
43
44
45 Set fetch or event breakpoint. The command specifies if the breakpoint
46 will be fix (<b>break</b>) or dynamic (temporary)
47 (<b>tbreak</b>).
48
49 <p>Fetch or event breakpoint can be defined. First form defines fetch
50 while second form defines event breakpoint.
51
52 <dl><dt>Fetch breakpoint
53
54 <dd>First parameter specifies address where the breakpoint must be
55 placed to. It should be address of an instruction.
56 <br>Second parameter is optional and it specifies the hit number. It is
57 1 by default.
58
59 <dt>Event breakpoint
60
61 <dd>First parameter specifies class name of memory where we are going
62 to watch for en event. Class names of memories can be checked by <a
63 href="cmd_general.html#info_memory">info memory</a> command.
64 <br>Second parameter specifies the event. It can be <b>r</b> to
65 specify <b>read</b> operation or <b>w</b> which means <b>write</b>
66 operation.
67 <br>Remaining parameters are address of watched memory location and an
68 optional hit number (1 by default).
69
70 </dl>
71
72 <pre>
73 $ <font color="#118811">s51 remoansi.hex</font>
74 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
75 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
76 This is free software, and you are welcome to redistribute it
77 under certain conditions; type `show c' for details.
78 58659 bytes read from remoansi.hex
79 > <font color="#118811">dc 0 0x10</font>
80    000000 02 01 60 LJMP  0160
81  * 000003 02 00 3c LJMP  003c
82  * 000006 ff       MOV   R7,A
83  * 000007 ff       MOV   R7,A
84  * 000008 ff       MOV   R7,A
85  * 000009 ff       MOV   R7,A
86  * 00000a ff       MOV   R7,A
87  * 00000b 02 3b e0 LJMP  3be0
88  * 00000e ff       MOV   R7,A
89  * 00000f ff       MOV   R7,A
90  * 000010 ff       MOV   R7,A
91 > <font color="#118811">break 0x160</font>
92 Breakpoint 1 at 0x000160: CLR   P1.0
93 > <font color="#118811">tbreak 8 2</font>
94 Breakpoint 2 at 0x000008: MOV   R7,A
95 > <font color="#118811">g</font>
96 Simulation started, PC=0x000000
97 Stop at 000160: (4) Breakpoint
98 F 000160
99 > </pre>
100
101 <hr>
102
103
104 <a name="clear"><h3>clear <i>[addr...]</i></h3></a>
105
106 Delete fetch breakpoint. Parameter specifies address of breakpoint. If
107 there is no breakpoint specified at given address this command prints
108 out a warning message.
109
110 <p>If parameter is not given then breakpoint at current PC will be
111 deleted if it exists. If more than one address is specified then all
112 breakpoints at specified addresses will be deleted.
113
114 <pre>
115 > <font color="#118811">i b</font>
116 Num Type       Disp Hit   Cnt   Address  What
117 1   fetch      keep 1     1     0x000160 CLR   P1.0
118 2   fetch      del  1     1     0x000180 LJMP  022a
119 1   event      keep 1     1     0x000006 wi
120 > <font color="#118811">clear 160</font>
121 No breakpoint at 0000a0
122 > <font color="#118811">clear 0x160</font>
123 > <font color="#118811">i b</font>
124 Num Type       Disp Hit   Cnt   Address  What
125 2   fetch      del  1     1     0x000180 LJMP  022a
126 1   event      keep 1     1     0x000006 wi
127 > </pre>
128
129 <hr>
130
131
132 <a name="delete"><h3>delete <i>[number...]</i></h3></a>
133
134 Delete breakpoint(s) by its number.
135
136 <p>If parameter is not used then all breakpoints are deleted.
137
138
139 <hr>
140
141 </body>
142 </html>