File: chapter07.html

package info (click to toggle)
tiemu 3.02-1.2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 8,964 kB
  • sloc: ansic: 32,554; sh: 9,561; cpp: 1,075; makefile: 585; xml: 71; sed: 16
file content (343 lines) | stat: -rw-r--r-- 12,662 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <meta name="GENERATOR" content="Mozilla 1.1 under Linux">
  <title>TiEmu User's Manual</title>
  <meta name="author" content="The TiEmu team">
  <meta name="description" content="User's Manual">
</head>
<body style="background-color: rgb(255, 255, 255);">
<div align="center">
<div style="text-align: left;">
<div class="NAVFOOTER">
<hr align="left" width="100%">
<table summary="Footer navigation table" border="0" cellpadding="0"
 cellspacing="0" width="100%">
  <tbody>
    <tr>
      <td align="left" valign="top" width="33%"><a href="chapter06.html"
 accesskey="P">Prev</a></td>
      <td align="center" valign="top" width="34%"><a
 href="Manual_en.html" accesskey="H">Home</a></td>
      <td align="right" valign="top" width="33%"><a
 href="chapter08.html" accesskey="N">Next</a></td>
    </tr>
    <tr>
      <td align="left" valign="top" width="33%">Popup menu<br>
      </td>
      <td align="center" valign="top" width="34%">&nbsp;</td>
      <td align="right" valign="top" width="33%">Screenshots<br>
      </td>
    </tr>
  </tbody>
</table>
<hr align="left" width="100%">
</div>
</div>
</div>
<h1>7. Debugger</h1>
Debugging mode is entered when a breakpoint is encountered or when the
user launches the debugger by the popup menu or by pressing the F11
key. This will stop the emulation engine but the LCD is still refreshed.<br>
<br>
Note: debugger windows are preloaded at startup in order to display
them quicker. The source code window may take a while to be displayed
the first time: this is due to ROM call parsing.<br>
<br>
TiEmu shows two debuggers simultaneously: a built-in assembly-level
debugger, and the GDB/Insight-derived source-level debugger (+gdb
release). These two
debuggers have been adapted to interoperate seamlessly.<br>
<br>
The assembly-level debugger is made-up of several frames:<br>
- source code<br>
- registers<br>
- memory<br>
- breakpoints<br>
- PC trace<br>
- stack<br>
- heap (handles)<br>
<br>
The source-level debugger is also made-up of several frames:
<ul>
  <li><a href="../../insight1.0/help/breakpoint.html">Breakpoint Window</a></li>
  <li><a href="../../insight1.0/help/console.html">Console Window</a></li>
  <li><a href="../../insight1.0/help/browser.html">Function Browser</a></li>
  <li><a href="../../insight1.0/help/locals.html">Locals Window</a></li>
  <li><a href="../../insight1.0/help/memory.html">Memory Window</a></li>
  <li><a href="../../insight1.0/help/register.html">Register Window</a></li>
  <li><a href="../../insight1.0/help/source.html">Source Window</a></li>
  <li><a href="../../insight1.0/help/stack.html">Stack Window</a></li>
  <li><a href="../../insight1.0/help/watch.html">Watch Window</a></li>
</ul>
These frames can be moved and/or resized (TiEmu saves/restores this
with
the configuration).<br>
Frames are automatically refreshed when a change occurs from another
frame.<br>
<br>
Moreover, these frames can be controlled (maximize/minimize &amp;
show/hide) from the Windows menu of the source code window (considered
as the main window).<br>
You can also change the <span style="font-style: italic;">transient</span>
mode. When enabled, all of the TiEmu windows are grouped together as
there was a single window.<br>
<h2>7.1 Source code<br>
</h2>
<div style="text-align: center;">
<div style="text-align: left;">This frame is the main one:<br>
</div>
<img alt="" src="dbg_source.png" style="width: 328px; height: 321px;"><br>
</div>
<br>
You can browse the source code with the arrow and PageUp/Down keys. The
green bar shows the current PC location. The blue one is the selection.
The
red cross is a breakpoint.<br>
<br>
By right-clicking, you get the popup menu:<br>
- <span style="font-style: italic;">go to address</span>: enter the
address to go,<br>
- <span style="font-style: italic;">go to PC</span>: jump to PC
location,<br>
- <span style="font-style: italic;">set breakpoint (F2)</span>: place
a breakpoint at the selection. The bkpt frame is updated,<br>
- <span style="font-style: italic;">set temporary breakpoint (F3)</span>:
place a breakpoint at the selection. This bkpt will be automatically
removed when encountered.<br>
- <span style="font-style: italic;">set PC to selection (F6)</span>:
load
PC with the address at the selection,<br>
- <span style="font-style: italic;">view memory (Ctrl+M)</span>: open
a tab in
the memory frame with the address at the selection.<br>
<br>
The combo box lets you choose a ROM call by using the arrow. You can
type it, too. It has automatic completion. Once selected, the view is
updated to begin on the ROM call's address.<br>
<br>
Debugging facilities provided are: <br>
- <span style="font-style: italic;">run (F5) / break (F11)</span>:
start/stop
emulation engine without closing frames, <br>
- <span style="font-style: italic;">step in/out/over (F7/F8/F9):</span><br>
&nbsp;&nbsp;&nbsp; step in equals to step by step<br>
&nbsp;&nbsp;&nbsp; step out runs PC until a RTS/RTR/RTD/RTE/STOP
instruction is reached (go out of the sub-routine)<br>
&nbsp;&nbsp;&nbsp; step over runs PC until the instruction after the
current one is reached (skips all code in a sub-routine for instance),
except for branches. <br>
&nbsp;&nbsp;&nbsp; This works for JSR/BSR/FLINE/DBCC/TRAP, <br>
- <span style="font-style: italic;">run to cursor (F4)</span>: runs PC
until the address under the cursor is reached.<br>
<br>
Miscellaneous shortcuts:<br>
- F1: set selection and PC to <span style="font-style: italic;">next</span>
line<br>
- 'd': copy source code window content to C:\disasm.txt
(unofficial
feature, for various purposes)<br>
- 'g': go to address (box)<br>
<h2>7.2 Registers</h2>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="text-align: center; vertical-align: top;"><img alt=""
 src="dbg_registers.png" style="width: 183px; height: 260px;"><br>
      </td>
      <td style="vertical-align: top;">This frame displays all of the
registers of the MC68000 processor. Take a look at the m68k
user's manual if needed.<br>
      <br>
USP = User Stack Pointer (A7 in user mode, S=0).<br>
SSP = System Stack Pointer (A7 is supervisor mode, S=1).<br>
The active pointer is displayed in the stack frame.<br>
      <br>
SR is displayed in 2 modes: hexadecimal and single flags.<br>
      <br>
Each field is in-place editable.<br>
      <br>
By right-clicking on the address/data registers content, you will open
a tab in the memory view at the adress contained in the register.
Useful for browsing pointers and/or arrays.<br>
      <div style="text-align: center;"><br>
      </div>
      </td>
    </tr>
  </tbody>
</table>
<br>
<h2>7.3 Memory</h2>
<div style="text-align: center;">
<div style="text-align: left;">
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><img alt="" src="dbg_mem.png"
 style="width: 534px; height: 274px;"></td>
      <td style="vertical-align: top;">You can add/remove as many tabs
as you want by clicking on +/-.<br>
Use the arrow keys or Page Up/Down keys to browse memory.<br>
The fifth button allow to refresh the current view.<br>
The last button (not shown) open a menu with a memory map of the
calculator. By clicking an item, you automatically create a new
tab at
the given address. Very helpful!<br>
      <br>
Each value can be edited in-place. Click the cell and you will be able
to enter an hexadecimal string (like 12, 1234, 567890).<br>
      <br>
By right-clicking, you will get the popup menu:<br>
- <span style="font-style: italic;">find / find next</span>: opens a
search dialog,<br>
- <span style="font-style: italic;">go to address</span>: lets you
enter a hexadecimal address to go to,<br>
- <span style="font-style: italic;">dis-assemble</span>: updates the
source frame at the selected address.<br>
      <br>
F1 to F6 keys are equivalent to pressing the corresponding toolbar
button.<br>
F7 and F8 allow you to move backward/forward into tabs.<br>
      </td>
    </tr>
  </tbody>
</table>
Note: The memory window may show aliases (ghosts) which does not
really exist on the real calculator. For instance, RAM on the TI-89
Titanium exists at 0x00000-0x3ffff only but if you open a tab at
0x40000, you will see RAM content at 0x000000. So, be careful!<br>
<br>
</div>
</div>
About the search dialog:<br>
<br>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><img alt="" src="dbg_search.png"
 style="width: 306px; height: 191px;"><br>
      </td>
      <td style="vertical-align: top;">You can search for hexadecimal
values or strings with or without case sensitivity (strings only).<br>
      <br>
Click the right button to start a search.<br>
Click the middle button to find the next occurrence.<br>
      <br>
The occurrence is highlighted in green in the memory frame.<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<h2>7.4 Breakpoints</h2>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><img alt="" src="dbg_bkpts.png"
 style="width: 351px; height: 210px;"><br>
      </td>
      <td style="vertical-align: top;">This frame lets you manage
several kinds of breakpoints:<br>
- bit change (*)<br>
- code (added from the source frame)<br>
- exception (traps, auto-ints, ...)<br>
- data access or range (*)<br>
- program entry (the debugger is raised at the beginning of the program
you
have just launched).<br>
      <br>
Each breakpoint can be added or removed and enabled or disabled (except
for prgm entry bkpts). You
can go to the breakpoint location, too (last toolbar button).<br>
      <br>
(*) Warning: those breakpoints occur after instruction execution so the
PC is pointing the instruction right after.<br>
      </td>
    </tr>
  </tbody>
</table>
<h2>7.5 PC trace</h2>
This frame shows the 10 latest PC values. Double-clicking the row will
update the source frame with the address in the row.<br>
<h2>7.6 Stack frame</h2>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><img alt="" src="dbg_stack.png"
 style="width: 168px; height: 284px;"><br>
      </td>
      <td style="vertical-align: top;">The 'A7 (stack) is' shows the
current active stack pointer (user/supervisor).<br>
      <br>
The frame displays the stack pointer (A7) and the frame pointer (A6)
used on the TI for function call and data storage.<br>
      <br>
Content is displayed as word values only. You can browse it by using
the arrow or Page Up/Down keys.<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<h2>7.7 Heap</h2>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><img alt="" src="dbg_heap.png"
 style="width: 168px; height: 274px;"><br>
      </td>
      <td style="vertical-align: top;">This frame displays all the
handles the calculator has. It shows: <br>
- handle number,<br>
- address in memory,<br>
- and size.<br>
      <br>
Double click the row to open a tab in the memory frame at the address
pointed by the handle.<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<h2>7.8 Logging</h2>
At the time being, only link logging is implemented.<br>
<h3>7.8.1 Link</h3>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><img src="log_link.png" alt=""
 style="width: 478px; height: 213px;" hspace="0"></td>
      <td style="vertical-align: top;">You can:<br>
-&nbsp; log data sent and/or received from/to link port,<br>
- increase/decrease size of buffer.<br>
      <br>
To start logging, press <span style="font-style: italic;">Start</span>
button and close (<span style="font-style: italic;">Close</span> button
or cross).<br>
To stop logging, press <span style="font-style: italic;">Stop</span>
button and close (<span style="font-style: italic;">Close</span> button
or cross).<br>
      <br>
The list contents is updated whenever you launch this box.<br>
      <br>
Contents can be saved at any time in text format by pressing the <span
 style="font-style: italic;">Save</span> button.<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<h2>7.9 <a href="../../insight1.0/help/index.html">Source-Level
Debugger</a></h2>
<hr>
</body>
</html>