]>
Commit | Line | Data |
---|---|---|
18fae2a8 RP |
1 | @c -*- Texinfo -*- |
2 | @c Copyright (c) 1990 1991 1992 1993 Free Software Foundation, Inc. | |
3 | @c This file is part of the source for the GDB manual. | |
4 | @c This text diverted to "Remote Debugging" section in general case; | |
5 | @c however, if we're doing a manual specifically for one of these, it | |
6 | @c belongs up front (in "Getting In and Out" chapter). | |
18fae2a8 | 7 | |
ed447b95 | 8 | @ifset REMOTESTUB |
18fae2a8 RP |
9 | @node Remote Serial |
10 | @subsection The @value{GDBN} remote serial protocol | |
11 | ||
12 | @cindex remote serial debugging, overview | |
13 | To debug a program running on another machine (the debugging | |
14 | @dfn{target} machine), you must first arrange for all the usual | |
15 | prerequisites for the program to run by itself. For example, for a C | |
16 | program, you need | |
17 | ||
18 | @enumerate | |
19 | @item | |
20 | A startup routine to set up the C runtime environment; these usually | |
21 | have a name like @file{crt0}. The startup routine may be supplied by | |
22 | your hardware supplier, or you may have to write your own. | |
23 | ||
24 | @item | |
25 | You probably need a C subroutine library to support your program's | |
26 | subroutine calls, notably managing input and output. | |
27 | ||
28 | @item | |
29 | A way of getting your program to the other machine---for example, a | |
30 | download program. These are often supplied by the hardware | |
31 | manufacturer, but you may have to write your own from hardware | |
32 | documentation. | |
33 | @end enumerate | |
34 | ||
35 | The next step is to arrange for your program to use a serial port to | |
36 | communicate with the machine where @value{GDBN} is running (the @dfn{host} | |
37 | machine). In general terms, the scheme looks like this: | |
38 | ||
39 | @table @emph | |
40 | @item On the host, | |
41 | @value{GDBN} already understands how to use this protocol; when everything | |
42 | else is set up, you can simply use the @samp{target remote} command | |
43 | (@pxref{Targets,,Specifying a Debugging Target}). | |
44 | ||
45 | @item On the target, | |
46 | you must link with your program a few special-purpose subroutines that | |
47 | implement the @value{GDBN} remote serial protocol. The file containing these | |
48 | subroutines is called a @dfn{debugging stub}. | |
49 | @end table | |
50 | ||
51 | The debugging stub is specific to the architecture of the remote | |
52 | machine; for example, use @file{sparc-stub.c} to debug programs on | |
53 | @sc{sparc} boards. | |
54 | ||
55 | @cindex remote serial stub list | |
56 | These working remote stubs are distributed with @value{GDBN}: | |
57 | ||
58 | @c FIXME! verify these... | |
59 | @table @code | |
60 | @item sparc-stub.c | |
61 | @kindex sparc-stub.c | |
62 | For @sc{sparc} architectures. | |
63 | ||
64 | @item m68k-stub.c | |
65 | @kindex m68-stub.c | |
66 | For Motorola 680x0 architectures. | |
67 | ||
68 | @item i386-stub.c | |
69 | @kindex i36-stub.c | |
70 | For Intel 386 and compatible architectures. | |
71 | @end table | |
72 | ||
73 | The @file{README} file in the @value{GDBN} distribution may list other | |
74 | recently added stubs. | |
75 | ||
76 | @menu | |
ed447b95 RP |
77 | * Stub Contents:: What the stub can do for you |
78 | * Bootstrapping:: What you must do for the stub | |
79 | * Debug Session:: Putting it all together | |
80 | * Protocol:: Outline of the communication protocol | |
18fae2a8 RP |
81 | @end menu |
82 | ||
ed447b95 | 83 | @node Stub Contents |
18fae2a8 RP |
84 | @subsubsection What the stub can do for you |
85 | ||
86 | @cindex remote serial stub | |
87 | The debugging stub for your architecture supplies these three | |
88 | subroutines: | |
89 | ||
90 | @table @code | |
91 | @item set_debug_traps | |
92 | @kindex set_debug_traps | |
93 | @cindex remote serial stub, initialization | |
8c69096b RP |
94 | This routine arranges for @code{handle_exception} to run when your |
95 | program stops. You must call this subroutine explicitly near the | |
96 | beginning of your program. | |
18fae2a8 RP |
97 | |
98 | @item handle_exception | |
99 | @kindex handle_exception | |
100 | @cindex remote serial stub, main routine | |
101 | This is the central workhorse, but your program never calls it | |
102 | explicitly---the setup code arranges for @code{handle_exception} to | |
103 | run when a trap is triggered. | |
104 | ||
105 | @code{handle_exception} takes control when your program stops during | |
106 | execution (for example, on a breakpoint), and mediates communications | |
107 | with @value{GDBN} on the host machine. This is where the communications | |
108 | protocol is implemented; @code{handle_exception} acts as the @value{GDBN} | |
109 | representative on the target machine; it begins by sending summary | |
110 | information on the state of your program, then continues to execute, | |
111 | retrieving and transmitting any information @value{GDBN} needs, until you | |
112 | execute a @value{GDBN} command that makes your program resume; at that point, | |
113 | @code{handle_exception} returns control to your own code on the target | |
114 | machine. | |
115 | ||
116 | @item breakpoint | |
117 | @cindex @code{breakpoint} subroutine, remote | |
118 | Use this auxiliary subroutine to make your program contain a | |
119 | breakpoint. Depending on the particular situation, this may be the only | |
120 | way for @value{GDBN} to get control. For instance, if your target | |
121 | machine has some sort of interrupt button, you won't need to call this; | |
122 | pressing the interrupt button will transfer control to | |
123 | @code{handle_exception}---in efect, to @value{GDBN}. On some machines, | |
124 | simply receiving characters on the serial port may also trigger a trap; | |
125 | again, in that situation, you don't need to call @code{breakpoint} from | |
126 | your own program---simply running @samp{target remote} from the host | |
127 | @value{GDBN} session will get control. | |
128 | ||
129 | Call @code{breakpoint} if none of these is true, or if you simply want | |
130 | to make certain your program stops at a predetermined point for the | |
131 | start of your debugging session. | |
132 | @end table | |
133 | ||
ed447b95 | 134 | @node Bootstrapping |
18fae2a8 RP |
135 | @subsubsection What you must do for the stub |
136 | ||
137 | @cindex remote stub, support routines | |
138 | The debugging stubs that come with @value{GDBN} are set up for a particular | |
139 | chip architecture, but they have no information about the rest of your | |
140 | debugging target machine. To allow the stub to work, you must supply | |
141 | these special low-level subroutines: | |
142 | ||
143 | @table @code | |
144 | @item int getDebugChar() | |
145 | @kindex getDebugChar | |
146 | Write this subroutine to read a single character from the serial port. | |
147 | It may be identical to @code{getchar} for your target system; a | |
148 | different name is used to allow you to distinguish the two if you wish. | |
149 | ||
150 | @item void putDebugChar(int) | |
151 | @kindex putDebugChar | |
152 | Write this subroutine to write a single character to the serial port. | |
153 | It may be identical to @code{putchar} for your target system; a | |
154 | different name is used to allow you to distinguish the two if you wish. | |
155 | ||
156 | @item void flush_i_cache() | |
157 | @kindex flush_i_cache | |
158 | Write this subroutine to flush the instruction cache, if any, on your | |
159 | target machine. If there is no instruction cache, this subroutine may | |
160 | be a no-op. | |
161 | ||
162 | On target machines that have instruction caches, @value{GDBN} requires this | |
163 | function to make certain that the state of your program is stable. | |
164 | @end table | |
165 | ||
166 | @noindent | |
167 | You must also make sure this library routine is available: | |
168 | ||
169 | @table @code | |
170 | @item void *memset(void *, int, int) | |
171 | @kindex memset | |
172 | This is the standard library function @code{memset} that sets an area of | |
173 | memory to a known value. If you have one of the free versions of | |
174 | @code{libc.a}, @code{memset} can be found there; otherwise, you must | |
175 | either obtain it from your hardware manufacturer, or write your own. | |
176 | @end table | |
177 | ||
178 | If you do not use the GNU C compiler, you may need other standard | |
179 | library subroutines as well; this will vary from one stub to another, | |
180 | but in general the stubs are likely to use any of the common library | |
181 | subroutines which @code{gcc} generates as inline code. | |
182 | ||
183 | ||
ed447b95 | 184 | @node Debug Session |
18fae2a8 RP |
185 | @subsubsection Putting it all together |
186 | ||
187 | @cindex remote serial debugging summary | |
188 | In summary, when your program is ready to debug, you must follow these | |
189 | steps. | |
190 | ||
191 | @enumerate | |
192 | @item | |
193 | Make sure you have the supporting low-level routines: | |
8c69096b RP |
194 | @display |
195 | @code{getDebugChar}, @code{putDebugChar}, | |
196 | @code{flush_i_cache}, @code{memset}. | |
197 | @end display | |
18fae2a8 RP |
198 | |
199 | @item | |
200 | Insert these lines near the top of your program: | |
201 | ||
202 | @example | |
203 | set_debug_traps(); | |
204 | breakpoint(); | |
205 | @end example | |
206 | ||
207 | @item | |
208 | Compile and link together: your program, the @value{GDBN} debugging stub for | |
209 | your target architecture, and the supporting subroutines. | |
210 | ||
211 | @item | |
212 | Make sure you have a serial connection between your target machine and | |
213 | the @value{GDBN} host, and identify the serial port used for this on the host. | |
214 | ||
215 | @item | |
216 | Download your program to your target machine (or get it there by | |
217 | whatever means the manufacturer provides), and start it. | |
218 | ||
219 | @item | |
220 | To start remote debugging, run @value{GDBN} on the host machine, and specify | |
221 | as an executable file the program that is running in the remote machine. | |
222 | This tells @value{GDBN} how to find your program's symbols and the contents | |
223 | of its pure text. | |
224 | ||
225 | Then establish communication using the @code{target remote} command. | |
226 | Its argument is the name of the device you're using to control the | |
227 | target machine. For example: | |
228 | ||
229 | @example | |
230 | target remote /dev/ttyb | |
231 | @end example | |
232 | ||
233 | @noindent | |
234 | if the serial line is connected to the device named @file{/dev/ttyb}. | |
235 | @ignore | |
236 | @c this is from the old text, but it doesn't seem to make sense now that I've | |
237 | @c seen an example... pesch 4sep1992 | |
238 | This will stop the remote machine if it is not already stopped. | |
239 | @end ignore | |
240 | ||
241 | @end enumerate | |
242 | ||
243 | Now you can use all the usual commands to examine and change data and to | |
244 | step and continue the remote program. | |
245 | ||
246 | To resume the remote program and stop debugging it, use the @code{detach} | |
247 | command. | |
248 | ||
ed447b95 | 249 | @node Protocol |
18fae2a8 RP |
250 | @subsubsection Outline of the communication protocol |
251 | ||
252 | @cindex debugging stub, example | |
253 | @cindex remote stub, example | |
254 | @cindex stub example, remote debugging | |
255 | The stub files provided with @value{GDBN} implement the target side of the | |
256 | communication protocol, and the @value{GDBN} side is implemented in the | |
257 | @value{GDBN} source file @file{remote.c}. Normally, you can simply allow | |
258 | these subroutines to communicate, and ignore the details. (If you're | |
259 | implementing your own stub file, you can still ignore the details: start | |
260 | with one of the existing stub files. @file{sparc-stub.c} is the best | |
261 | organized, and therefore the easiest to read.) | |
262 | ||
263 | However, there may be occasions when you need to know something about | |
264 | the protocol---for example, if there is only one serial port to your | |
265 | target machine, you might want your program to do something special if | |
266 | it recognizes a packet meant for @value{GDBN}. | |
267 | ||
268 | @cindex protocol, @value{GDBN} remote serial | |
269 | @cindex serial protocol, @value{GDBN} remote | |
270 | @cindex remote serial protocol | |
271 | All @value{GDBN} commands and responses (other than acknowledgements, which | |
272 | are single characters) are sent as a packet which includes a | |
273 | checksum. A packet is introduced with the character @samp{$}, and ends | |
274 | with the character @samp{#} followed by a two-digit checksum: | |
275 | ||
276 | @example | |
277 | $@var{packet info}#@var{checksum} | |
278 | @end example | |
279 | ||
280 | @cindex checksum, for @value{GDBN} remote | |
281 | @noindent | |
282 | @var{checksum} is computed as the modulo 256 sum of the @var{packet | |
283 | info} characters. | |
284 | ||
285 | When either the host or the target machine receives a packet, the first | |
286 | response expected is an acknowledgement: a single character, either | |
287 | @samp{+} (to indicate the package was received correctly) or @samp{-} | |
288 | (to request retransmission). | |
289 | ||
290 | The host (@value{GDBN}) sends commands, and the target (the debugging stub | |
291 | incorporated in your program) sends data in response. The target also | |
292 | sends data when your program stops. | |
293 | ||
294 | Command packets are distinguished by their first character, which | |
295 | identifies the kind of command. | |
296 | ||
297 | These are the commands currently supported: | |
298 | ||
299 | @table @code | |
300 | @item g | |
301 | Requests the values of CPU registers. | |
302 | ||
303 | @item G | |
304 | Sets the values of CPU registers. | |
305 | ||
306 | @item m@var{addr},@var{count} | |
307 | Read @var{count} bytes at location @var{addr}. | |
308 | ||
309 | @item M@var{addr},@var{count}:@dots{} | |
310 | Write @var{count} bytes at location @var{addr}. | |
311 | ||
312 | @item c | |
313 | @itemx c@var{addr} | |
314 | Resume execution at the current address (or at @var{addr} if supplied). | |
315 | ||
316 | @item s | |
317 | @itemx s@var{addr} | |
318 | Step the target program for one instruction, from either the current | |
319 | program counter or from @var{addr} if supplied. | |
320 | ||
321 | @item k | |
322 | Kill the target program. | |
323 | ||
324 | @item ? | |
325 | Report the most recent signal. To allow you to take advantage of the | |
326 | @value{GDBN} signal handling commands, one of the functions of the debugging | |
327 | stub is to report CPU traps as the corresponding POSIX signal values. | |
328 | @end table | |
329 | ||
330 | @kindex set remotedebug | |
331 | @kindex show remotedebug | |
332 | @cindex packets, reporting on stdout | |
333 | @cindex serial connections, debugging | |
334 | If you have trouble with the serial connection, you can use the command | |
335 | @code{set remotedebug}. This makes @value{GDBN} report on all packets sent | |
336 | back and forth across the serial line to the remote machine. The | |
337 | packet-debugging information is printed on the @value{GDBN} standard output | |
338 | stream. @code{set remotedebug off} turns it off, and @code{show | |
339 | remotedebug} will show you its current state. | |
340 | @end ifset | |
341 | ||
a64a6c2b | 342 | @ifset I960 |
18fae2a8 | 343 | @node i960-Nindy Remote |
93928b60 | 344 | @subsection @value{GDBN} with a remote i960 (Nindy) |
18fae2a8 RP |
345 | |
346 | @cindex Nindy | |
347 | @cindex i960 | |
348 | @dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When | |
349 | @value{GDBN} is configured to control a remote Intel 960 using Nindy, you can | |
350 | tell @value{GDBN} how to connect to the 960 in several ways: | |
351 | ||
352 | @itemize @bullet | |
353 | @item | |
354 | Through command line options specifying serial port, version of the | |
355 | Nindy protocol, and communications speed; | |
356 | ||
357 | @item | |
358 | By responding to a prompt on startup; | |
359 | ||
360 | @item | |
361 | By using the @code{target} command at any point during your @value{GDBN} | |
93928b60 | 362 | session. @xref{Target Commands, ,Commands for managing targets}. |
18fae2a8 RP |
363 | |
364 | @end itemize | |
365 | ||
366 | @menu | |
367 | * Nindy Startup:: Startup with Nindy | |
368 | * Nindy Options:: Options for Nindy | |
ed447b95 | 369 | * Nindy Reset:: Nindy reset command |
18fae2a8 RP |
370 | @end menu |
371 | ||
372 | @node Nindy Startup | |
373 | @subsubsection Startup with Nindy | |
374 | ||
375 | If you simply start @code{@value{GDBP}} without using any command-line | |
376 | options, you are prompted for what serial port to use, @emph{before} you | |
377 | reach the ordinary @value{GDBN} prompt: | |
378 | ||
379 | @example | |
380 | Attach /dev/ttyNN -- specify NN, or "quit" to quit: | |
381 | @end example | |
382 | ||
383 | @noindent | |
384 | Respond to the prompt with whatever suffix (after @samp{/dev/tty}) | |
385 | identifies the serial port you want to use. You can, if you choose, | |
386 | simply start up with no Nindy connection by responding to the prompt | |
ed447b95 | 387 | with an empty line. If you do this and later wish to attach to Nindy, |
93928b60 | 388 | use @code{target} (@pxref{Target Commands, ,Commands for managing targets}). |
18fae2a8 RP |
389 | |
390 | @node Nindy Options | |
391 | @subsubsection Options for Nindy | |
392 | ||
393 | These are the startup options for beginning your @value{GDBN} session with a | |
394 | Nindy-960 board attached: | |
395 | ||
396 | @table @code | |
397 | @item -r @var{port} | |
398 | Specify the serial port name of a serial interface to be used to connect | |
399 | to the target system. This option is only available when @value{GDBN} is | |
400 | configured for the Intel 960 target architecture. You may specify | |
401 | @var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a | |
402 | device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique | |
403 | suffix for a specific @code{tty} (e.g. @samp{-r a}). | |
404 | ||
405 | @item -O | |
406 | (An uppercase letter ``O'', not a zero.) Specify that @value{GDBN} should use | |
407 | the ``old'' Nindy monitor protocol to connect to the target system. | |
408 | This option is only available when @value{GDBN} is configured for the Intel 960 | |
409 | target architecture. | |
410 | ||
411 | @quotation | |
412 | @emph{Warning:} if you specify @samp{-O}, but are actually trying to | |
413 | connect to a target system that expects the newer protocol, the connection | |
414 | will fail, appearing to be a speed mismatch. @value{GDBN} will repeatedly | |
415 | attempt to reconnect at several different line speeds. You can abort | |
416 | this process with an interrupt. | |
417 | @end quotation | |
418 | ||
419 | @item -brk | |
420 | Specify that @value{GDBN} should first send a @code{BREAK} signal to the target | |
421 | system, in an attempt to reset it, before connecting to a Nindy target. | |
422 | ||
423 | @quotation | |
424 | @emph{Warning:} Many target systems do not have the hardware that this | |
425 | requires; it only works with a few boards. | |
426 | @end quotation | |
427 | @end table | |
428 | ||
429 | The standard @samp{-b} option controls the line speed used on the serial | |
430 | port. | |
431 | ||
432 | @c @group | |
ed447b95 | 433 | @node Nindy Reset |
93928b60 | 434 | @subsubsection Nindy reset command |
18fae2a8 RP |
435 | |
436 | @table @code | |
437 | @item reset | |
438 | @kindex reset | |
439 | For a Nindy target, this command sends a ``break'' to the remote target | |
440 | system; this is only useful if the target has been equipped with a | |
441 | circuit to perform a hard reset (or some other interesting action) when | |
442 | a break is detected. | |
443 | @end table | |
444 | @c @end group | |
445 | @end ifset | |
446 | ||
a64a6c2b | 447 | @ifset AMD29K |
fe715d06 RP |
448 | @node UDI29K Remote |
449 | @subsection @value{GDBN} and the UDI protocol for AMD29K | |
450 | ||
451 | @cindex UDI | |
452 | @cindex AMD29K via UDI | |
453 | @value{GDBN} supports AMD's UDI (``Universal Debugger Interface'') | |
d7d35f00 | 454 | protocol for debugging the a29k processor family. To use this |
fe715d06 RP |
455 | configuration with AMD targets running the MiniMON monitor, you need the |
456 | program @code{MONTIP}, available from AMD at no charge. You can also | |
d7d35f00 | 457 | use @value{GDBN} with the UDI conformant a29k simulator program |
fe715d06 RP |
458 | @code{ISSTIP}, also available from AMD. |
459 | ||
460 | @table @code | |
461 | @item target udi @var{keyword} | |
462 | @kindex udi | |
d7d35f00 | 463 | Select the UDI interface to a remote a29k board or simulator, where |
fe715d06 RP |
464 | @var{keyword} is an entry in the AMD configuration file @file{udi_soc}. |
465 | This file contains keyword entries which specify parameters used to | |
d7d35f00 | 466 | connect to a29k targets. If the @file{udi_soc} file is not in your |
fe715d06 RP |
467 | working directory, you must set the environment variable @samp{UDICONF} |
468 | to its pathname. | |
469 | @end table | |
470 | ||
18fae2a8 | 471 | @node EB29K Remote |
93928b60 | 472 | @subsection @value{GDBN} with a remote EB29K |
18fae2a8 RP |
473 | |
474 | @cindex EB29K board | |
475 | @cindex running 29K programs | |
476 | ||
477 | To use @value{GDBN} from a Unix system to run programs on AMD's EB29K | |
478 | board in a PC, you must first connect a serial cable between the PC | |
479 | and a serial port on the Unix system. In the following, we assume | |
480 | you've hooked the cable between the PC's @file{COM1} port and | |
481 | @file{/dev/ttya} on the Unix system. | |
482 | ||
483 | @menu | |
ed447b95 | 484 | * Comms (EB29K):: Communications setup |
18fae2a8 | 485 | * gdb-EB29K:: EB29K cross-debugging |
ed447b95 | 486 | * Remote Log:: Remote log |
18fae2a8 RP |
487 | @end menu |
488 | ||
489 | @node Comms (EB29K) | |
93928b60 | 490 | @subsubsection Communications setup |
18fae2a8 | 491 | |
ed447b95 RP |
492 | The next step is to set up the PC's port, by doing something like this |
493 | in DOS on the PC: | |
18fae2a8 RP |
494 | |
495 | @example | |
496 | C:\> MODE com1:9600,n,8,1,none | |
497 | @end example | |
498 | ||
499 | @noindent | |
500 | This example---run on an MS DOS 4.0 system---sets the PC port to 9600 | |
501 | bps, no parity, eight data bits, one stop bit, and no ``retry'' action; | |
502 | you must match the communications parameters when establishing the Unix | |
503 | end of the connection as well. | |
504 | @c FIXME: Who knows what this "no retry action" crud from the DOS manual may | |
505 | @c mean? It's optional; leave it out? [email protected], 25feb91 | |
506 | ||
507 | To give control of the PC to the Unix side of the serial line, type | |
508 | the following at the DOS console: | |
509 | ||
510 | @example | |
511 | C:\> CTTY com1 | |
512 | @end example | |
513 | ||
514 | @noindent | |
515 | (Later, if you wish to return control to the DOS console, you can use | |
516 | the command @code{CTTY con}---but you must send it over the device that | |
517 | had control, in our example over the @file{COM1} serial line). | |
518 | ||
519 | From the Unix host, use a communications program such as @code{tip} or | |
520 | @code{cu} to communicate with the PC; for example, | |
521 | ||
522 | @example | |
523 | cu -s 9600 -l /dev/ttya | |
524 | @end example | |
525 | ||
526 | @noindent | |
527 | The @code{cu} options shown specify, respectively, the linespeed and the | |
528 | serial port to use. If you use @code{tip} instead, your command line | |
529 | may look something like the following: | |
530 | ||
531 | @example | |
532 | tip -9600 /dev/ttya | |
533 | @end example | |
534 | ||
535 | @noindent | |
fe715d06 | 536 | Your system may require a different name where we show |
18fae2a8 RP |
537 | @file{/dev/ttya} as the argument to @code{tip}. The communications |
538 | parameters, including which port to use, are associated with the | |
539 | @code{tip} argument in the ``remote'' descriptions file---normally the | |
540 | system table @file{/etc/remote}. | |
541 | @c FIXME: What if anything needs doing to match the "n,8,1,none" part of | |
542 | @c the DOS side's comms setup? cu can support -o (odd | |
543 | @c parity), -e (even parity)---apparently no settings for no parity or | |
544 | @c for character size. Taken from stty maybe...? John points out tip | |
545 | @c can set these as internal variables, eg ~s parity=none; man stty | |
546 | @c suggests that it *might* work to stty these options with stdin or | |
547 | @c stdout redirected... [email protected], 25feb91 | |
548 | ||
549 | @kindex EBMON | |
550 | Using the @code{tip} or @code{cu} connection, change the DOS working | |
551 | directory to the directory containing a copy of your 29K program, then | |
552 | start the PC program @code{EBMON} (an EB29K control program supplied | |
553 | with your board by AMD). You should see an initial display from | |
554 | @code{EBMON} similar to the one that follows, ending with the | |
555 | @code{EBMON} prompt @samp{#}--- | |
556 | ||
557 | @example | |
558 | C:\> G: | |
559 | ||
560 | G:\> CD \usr\joe\work29k | |
561 | ||
562 | G:\USR\JOE\WORK29K> EBMON | |
563 | Am29000 PC Coprocessor Board Monitor, version 3.0-18 | |
564 | Copyright 1990 Advanced Micro Devices, Inc. | |
565 | Written by Gibbons and Associates, Inc. | |
566 | ||
567 | Enter '?' or 'H' for help | |
568 | ||
569 | PC Coprocessor Type = EB29K | |
570 | I/O Base = 0x208 | |
571 | Memory Base = 0xd0000 | |
572 | ||
573 | Data Memory Size = 2048KB | |
574 | Available I-RAM Range = 0x8000 to 0x1fffff | |
575 | Available D-RAM Range = 0x80002000 to 0x801fffff | |
576 | ||
577 | PageSize = 0x400 | |
578 | Register Stack Size = 0x800 | |
579 | Memory Stack Size = 0x1800 | |
580 | ||
581 | CPU PRL = 0x3 | |
582 | Am29027 Available = No | |
583 | Byte Write Available = Yes | |
584 | ||
585 | # ~. | |
586 | @end example | |
587 | ||
588 | Then exit the @code{cu} or @code{tip} program (done in the example by | |
589 | typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep | |
590 | running, ready for @value{GDBN} to take over. | |
591 | ||
592 | For this example, we've assumed what is probably the most convenient | |
593 | way to make sure the same 29K program is on both the PC and the Unix | |
594 | system: a PC/NFS connection that establishes ``drive @code{G:}'' on the | |
595 | PC as a file system on the Unix host. If you do not have PC/NFS or | |
596 | something similar connecting the two systems, you must arrange some | |
597 | other way---perhaps floppy-disk transfer---of getting the 29K program | |
598 | from the Unix system to the PC; @value{GDBN} will @emph{not} download it over the | |
599 | serial line. | |
600 | ||
601 | @node gdb-EB29K | |
602 | @subsubsection EB29K cross-debugging | |
603 | ||
604 | Finally, @code{cd} to the directory containing an image of your 29K | |
605 | program on the Unix system, and start @value{GDBN}---specifying as argument the | |
606 | name of your 29K program: | |
607 | ||
608 | @example | |
609 | cd /usr/joe/work29k | |
610 | @value{GDBP} myfoo | |
611 | @end example | |
612 | ||
613 | Now you can use the @code{target} command: | |
614 | ||
615 | @example | |
616 | target amd-eb /dev/ttya 9600 MYFOO | |
617 | @c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to | |
618 | @c emphasize that this is the name as seen by DOS (since I think DOS is | |
619 | @c single-minded about case of letters). [email protected], 25feb91 | |
620 | @end example | |
621 | ||
622 | @noindent | |
623 | In this example, we've assumed your program is in a file called | |
624 | @file{myfoo}. Note that the filename given as the last argument to | |
625 | @code{target amd-eb} should be the name of the program as it appears to DOS. | |
626 | In our example this is simply @code{MYFOO}, but in general it can include | |
627 | a DOS path, and depending on your transfer mechanism may not resemble | |
628 | the name on the Unix side. | |
629 | ||
630 | At this point, you can set any breakpoints you wish; when you are ready | |
631 | to see your program run on the 29K board, use the @value{GDBN} command | |
632 | @code{run}. | |
633 | ||
634 | To stop debugging the remote program, use the @value{GDBN} @code{detach} | |
635 | command. | |
636 | ||
637 | To return control of the PC to its console, use @code{tip} or @code{cu} | |
638 | once again, after your @value{GDBN} session has concluded, to attach to | |
639 | @code{EBMON}. You can then type the command @code{q} to shut down | |
640 | @code{EBMON}, returning control to the DOS command-line interpreter. | |
641 | Type @code{CTTY con} to return command input to the main DOS console, | |
642 | and type @kbd{~.} to leave @code{tip} or @code{cu}. | |
643 | ||
644 | @node Remote Log | |
93928b60 | 645 | @subsubsection Remote log |
18fae2a8 RP |
646 | @kindex eb.log |
647 | @cindex log file for EB29K | |
648 | ||
649 | The @code{target amd-eb} command creates a file @file{eb.log} in the | |
650 | current working directory, to help debug problems with the connection. | |
651 | @file{eb.log} records all the output from @code{EBMON}, including echoes | |
652 | of the commands sent to it. Running @samp{tail -f} on this file in | |
653 | another window often helps to understand trouble with @code{EBMON}, or | |
654 | unexpected events on the PC side of the connection. | |
655 | ||
656 | @end ifset | |
657 | ||
a64a6c2b | 658 | @ifset ST2000 |
18fae2a8 RP |
659 | @node ST2000 Remote |
660 | @subsection @value{GDBN} with a Tandem ST2000 | |
661 | ||
662 | To connect your ST2000 to the host system, see the manufacturer's | |
663 | manual. Once the ST2000 is physically attached, you can run | |
664 | ||
665 | @example | |
666 | target st2000 @var{dev} @var{speed} | |
667 | @end example | |
668 | ||
669 | @noindent | |
670 | to establish it as your debugging environment. | |
671 | ||
672 | The @code{load} and @code{attach} commands are @emph{not} defined for | |
673 | this target; you must load your program into the ST2000 as you normally | |
674 | would for standalone operation. @value{GDBN} will read debugging information | |
675 | (such as symbols) from a separate, debugging version of the program | |
676 | available on your host computer. | |
677 | @c FIXME!! This is terribly vague; what little content is here is | |
678 | @c basically hearsay. | |
679 | ||
680 | @cindex ST2000 auxiliary commands | |
681 | These auxiliary @value{GDBN} commands are available to help you with the ST2000 | |
682 | environment: | |
683 | ||
684 | @table @code | |
685 | @item st2000 @var{command} | |
686 | @kindex st2000 @var{cmd} | |
687 | @cindex STDBUG commands (ST2000) | |
688 | @cindex commands to STDBUG (ST2000) | |
689 | Send a @var{command} to the STDBUG monitor. See the manufacturer's | |
690 | manual for available commands. | |
691 | ||
692 | @item connect | |
693 | @cindex connect (to STDBUG) | |
694 | Connect the controlling terminal to the STDBUG command monitor. When | |
695 | you are done interacting with STDBUG, typing either of two character | |
696 | sequences will get you back to the @value{GDBN} command prompt: | |
697 | @kbd{@key{RET}~.} (Return, followed by tilde and period) or | |
698 | @kbd{@key{RET}~@key{C-d}} (Return, followed by tilde and control-D). | |
699 | @end table | |
700 | @end ifset | |
701 | ||
702 | @ifset VXWORKS | |
703 | @node VxWorks Remote | |
704 | @subsection @value{GDBN} and VxWorks | |
705 | @cindex VxWorks | |
706 | ||
707 | @value{GDBN} enables developers to spawn and debug tasks running on networked | |
708 | VxWorks targets from a Unix host. Already-running tasks spawned from | |
709 | the VxWorks shell can also be debugged. @value{GDBN} uses code that runs on | |
710 | both the UNIX host and on the VxWorks target. The program | |
711 | @code{@value{GDBP}} is installed and executed on the UNIX host. | |
712 | ||
713 | The following information on connecting to VxWorks was current when | |
714 | this manual was produced; newer releases of VxWorks may use revised | |
715 | procedures. | |
716 | ||
717 | The remote debugging interface (RDB) routines are installed and executed | |
718 | on the VxWorks target. These routines are included in the VxWorks library | |
719 | @file{rdb.a} and are incorporated into the system image when source-level | |
720 | debugging is enabled in the VxWorks configuration. | |
721 | ||
722 | @kindex INCLUDE_RDB | |
723 | If you wish, you can define @code{INCLUDE_RDB} in the VxWorks | |
724 | configuration file @file{configAll.h} to include the RDB interface | |
725 | routines and spawn the source debugging task @code{tRdbTask} when | |
726 | VxWorks is booted. For more information on configuring and remaking | |
727 | VxWorks, see the manufacturer's manual. | |
728 | @c VxWorks, see the @cite{VxWorks Programmer's Guide}. | |
729 | ||
730 | Once you have included the RDB interface in your VxWorks system image | |
731 | and set your Unix execution search path to find @value{GDBN}, you are ready | |
732 | to run @value{GDBN}. From your UNIX host, type: | |
733 | ||
ed447b95 | 734 | @example |
18fae2a8 | 735 | % @value{GDBP} |
ed447b95 | 736 | @end example |
18fae2a8 RP |
737 | |
738 | @value{GDBN} will come up showing the prompt: | |
739 | ||
ed447b95 | 740 | @example |
18fae2a8 | 741 | (@value{GDBP}) |
ed447b95 | 742 | @end example |
18fae2a8 RP |
743 | |
744 | @menu | |
ed447b95 RP |
745 | * VxWorks Connection:: Connecting to VxWorks |
746 | * VxWorks Download:: VxWorks download | |
747 | * VxWorks Attach:: Running tasks | |
18fae2a8 RP |
748 | @end menu |
749 | ||
ed447b95 | 750 | @node VxWorks Connection |
18fae2a8 RP |
751 | @subsubsection Connecting to VxWorks |
752 | ||
753 | The @value{GDBN} command @code{target} lets you connect to a VxWorks target on the | |
754 | network. To connect to a target whose host name is ``@code{tt}'', type: | |
755 | ||
ed447b95 | 756 | @example |
18fae2a8 | 757 | (@value{GDBP}) target vxworks tt |
ed447b95 | 758 | @end example |
18fae2a8 RP |
759 | |
760 | @value{GDBN} will display a message similar to the following: | |
761 | ||
762 | @smallexample | |
763 | Attaching remote machine across net... Success! | |
764 | @end smallexample | |
765 | ||
766 | @value{GDBN} will then attempt to read the symbol tables of any object modules | |
767 | loaded into the VxWorks target since it was last booted. @value{GDBN} locates | |
768 | these files by searching the directories listed in the command search | |
93928b60 | 769 | path (@pxref{Environment, ,Your program's environment}); if it fails |
18fae2a8 RP |
770 | to find an object file, it will display a message such as: |
771 | ||
ed447b95 | 772 | @example |
18fae2a8 | 773 | prog.o: No such file or directory. |
ed447b95 | 774 | @end example |
18fae2a8 RP |
775 | |
776 | This will cause the @code{target} command to abort. When this happens, | |
777 | you should add the appropriate directory to the search path, with the | |
778 | @value{GDBN} command @code{path}, and execute the @code{target} command | |
779 | again. | |
780 | ||
ed447b95 | 781 | @node VxWorks Download |
93928b60 | 782 | @subsubsection VxWorks download |
18fae2a8 RP |
783 | |
784 | @cindex download to VxWorks | |
785 | If you have connected to the VxWorks target and you want to debug an | |
786 | object that has not yet been loaded, you can use the @value{GDBN} @code{load} | |
787 | command to download a file from UNIX to VxWorks incrementally. The | |
788 | object file given as an argument to the @code{load} command is actually | |
789 | opened twice: first by the VxWorks target in order to download the code, | |
790 | then by @value{GDBN} in order to read the symbol table. This can lead to | |
791 | problems if the current working directories on the two systems differ. | |
792 | It is simplest to set the working directory on both systems to the | |
793 | directory in which the object file resides, and then to reference the | |
794 | file by its name, without any path. Thus, to load a program | |
795 | @file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type: | |
796 | ||
ed447b95 | 797 | @example |
18fae2a8 | 798 | -> cd "wherever/vw/demo/rdb" |
ed447b95 | 799 | @end example |
18fae2a8 RP |
800 | |
801 | On @value{GDBN} type: | |
802 | ||
ed447b95 | 803 | @example |
18fae2a8 RP |
804 | (@value{GDBP}) cd wherever/vw/demo/rdb |
805 | (@value{GDBP}) load prog.o | |
ed447b95 | 806 | @end example |
18fae2a8 RP |
807 | |
808 | @value{GDBN} will display a response similar to the following: | |
809 | ||
810 | @smallexample | |
811 | Reading symbol data from wherever/vw/demo/rdb/prog.o... done. | |
812 | @end smallexample | |
813 | ||
814 | You can also use the @code{load} command to reload an object module | |
815 | after editing and recompiling the corresponding source file. Note that | |
816 | this will cause @value{GDBN} to delete all currently-defined breakpoints, | |
817 | auto-displays, and convenience variables, and to clear the value | |
818 | history. (This is necessary in order to preserve the integrity of | |
819 | debugger data structures that reference the target system's symbol | |
820 | table.) | |
821 | ||
ed447b95 | 822 | @node VxWorks Attach |
93928b60 | 823 | @subsubsection Running tasks |
18fae2a8 RP |
824 | |
825 | @cindex running VxWorks tasks | |
826 | You can also attach to an existing task using the @code{attach} command as | |
827 | follows: | |
828 | ||
ed447b95 | 829 | @example |
18fae2a8 | 830 | (@value{GDBP}) attach @var{task} |
ed447b95 | 831 | @end example |
18fae2a8 RP |
832 | |
833 | @noindent | |
834 | where @var{task} is the VxWorks hexadecimal task ID. The task can be running | |
835 | or suspended when you attach to it. If running, it will be suspended at | |
836 | the time of attachment. | |
837 | @end ifset | |
838 | ||
a64a6c2b RP |
839 | @ifset H8 |
840 | @node Hitachi Remote | |
841 | @subsection @value{GDBN} and Hitachi Microprocessors | |
842 | @value{GDBN} needs to know these things to talk to your | |
843 | Hitachi SH, H8/300, or H8/500: | |
18fae2a8 RP |
844 | |
845 | @enumerate | |
846 | @item | |
a64a6c2b RP |
847 | that you want to use @samp{target hms}, the remote debugging interface |
848 | for Hitachi microprocessors (this is the default when GDB is configured | |
849 | specifically for the Hitachi SH, H8/300, or H8/500); | |
18fae2a8 RP |
850 | |
851 | @item | |
1d7c3357 RP |
852 | what serial device connects your host to your Hitachi board (the first |
853 | serial device available on your host is the default); | |
18fae2a8 RP |
854 | |
855 | @ignore | |
856 | @c this is only for Unix hosts, not currently of interest. | |
857 | @item | |
858 | what speed to use over the serial device. | |
859 | @end ignore | |
860 | @end enumerate | |
861 | ||
a64a6c2b | 862 | @ifclear H8EXCLUSIVE |
18fae2a8 | 863 | @c only for Unix hosts |
1d7c3357 | 864 | @kindex device |
a64a6c2b | 865 | @cindex serial device, Hitachi micros |
1d7c3357 | 866 | Use the special @code{@value{GDBP}} command @samp{device @var{port}} if you |
18fae2a8 RP |
867 | need to explicitly set the serial device. The default @var{port} is the |
868 | first available port on your host. This is only necessary on Unix | |
869 | hosts, where it is typically something like @file{/dev/ttya}. | |
870 | ||
871 | @kindex speed | |
a64a6c2b | 872 | @cindex serial line speed, Hitachi micros |
1d7c3357 RP |
873 | @code{@value{GDBP}} has another special command to set the communications |
874 | speed: @samp{speed @var{bps}}. This command also is only used from Unix | |
875 | hosts; on DOS hosts, set the line speed as usual from outside GDB with | |
876 | the DOS @kbd{mode} command (for instance, @w{@samp{mode | |
18fae2a8 | 877 | com2:9600,n,8,1,p}} for a 9600 bps connection). |
18fae2a8 | 878 | |
a64a6c2b RP |
879 | The @samp{device} and @samp{speed} commands are available only when you |
880 | use a Unix host to debug your Hitachi microprocessor programs. If you | |
881 | use a DOS host, | |
882 | @end ifclear | |
18fae2a8 | 883 | @value{GDBN} depends on an auxiliary terminate-and-stay-resident program |
1d7c3357 | 884 | called @code{asynctsr} to communicate with the development board |
18fae2a8 RP |
885 | through a PC serial port. You must also use the DOS @code{mode} command |
886 | to set up the serial port on the DOS side. | |
887 | ||
a64a6c2b | 888 | @ifset DOSHOST |
18fae2a8 | 889 | The following sample session illustrates the steps needed to start a |
a64a6c2b RP |
890 | program under @value{GDBN} control on an H8/300. The example uses a |
891 | sample H8/300 program called @file{t.x}. The procedure is the same for | |
892 | the Hitachi SH and the H8/500. | |
18fae2a8 | 893 | |
1d7c3357 | 894 | First hook up your development board. In this example, we use a |
18fae2a8 RP |
895 | board attached to serial port @code{COM2}; if you use a different serial |
896 | port, substitute its name in the argument of the @code{mode} command. | |
897 | When you call @code{asynctsr}, the auxiliary comms program used by the | |
898 | degugger, you give it just the numeric part of the serial port's name; | |
899 | for example, @samp{asyncstr 2} below runs @code{asyncstr} on | |
900 | @code{COM2}. | |
901 | ||
ed447b95 | 902 | @example |
18fae2a8 RP |
903 | (eg-C:\H8300\TEST) mode com2:9600,n,8,1,p |
904 | ||
905 | Resident portion of MODE loaded | |
906 | ||
907 | COM2: 9600, n, 8, 1, p | |
908 | ||
909 | (eg-C:\H8300\TEST) asynctsr 2 | |
ed447b95 | 910 | @end example |
18fae2a8 RP |
911 | |
912 | @quotation | |
913 | @emph{Warning:} We have noticed a bug in PC-NFS that conflicts with | |
914 | @code{asynctsr}. If you also run PC-NFS on your DOS host, you may need to | |
915 | disable it, or even boot without it, to use @code{asynctsr} to control | |
1d7c3357 | 916 | your development board. |
18fae2a8 RP |
917 | @end quotation |
918 | ||
1d7c3357 RP |
919 | @kindex target hms |
920 | Now that serial communications are set up, and the development board is | |
921 | connected, you can start up @value{GDBN}. Call @code{@value{GDBP}} with | |
922 | the name of your program as the argument. @code{@value{GDBP}} prompts | |
923 | you, as usual, with the prompt @samp{(@value{GDBP})}. Use two special | |
924 | commands to begin your debugging session: @samp{target hms} to specify | |
925 | cross-debugging to the Hitachi board, and the @code{load} command to | |
926 | download your program to the board. @code{load} displays the names of | |
927 | the program's sections, and a @samp{*} for each 2K of data downloaded. | |
928 | (If you want to refresh @value{GDBN} data on symbols or on the | |
929 | executable file without downloading, use the @value{GDBN} commands | |
930 | @code{file} or @code{symbol-file}. These commands, and @code{load} | |
931 | itself, are described in @ref{Files,,Commands to specify files}.) | |
18fae2a8 RP |
932 | |
933 | @smallexample | |
934 | (eg-C:\H8300\TEST) @value{GDBP} t.x | |
935 | GDB is free software and you are welcome to distribute copies | |
936 | of it under certain conditions; type "show copying" to see | |
937 | the conditions. | |
938 | There is absolutely no warranty for GDB; type "show warranty" | |
939 | for details. | |
940 | GDB @value{GDBVN}, Copyright 1992 Free Software Foundation, Inc... | |
941 | (gdb) target hms | |
942 | Connected to remote H8/300 HMS system. | |
943 | (gdb) load t.x | |
944 | .text : 0x8000 .. 0xabde *********** | |
945 | .data : 0xabde .. 0xad30 * | |
946 | .stack : 0xf000 .. 0xf014 * | |
947 | @end smallexample | |
948 | ||
949 | At this point, you're ready to run or debug your program. From here on, | |
950 | you can use all the usual @value{GDBN} commands. The @code{break} command | |
951 | sets breakpoints; the @code{run} command starts your program; | |
952 | @code{print} or @code{x} display data; the @code{continue} command | |
953 | resumes execution after stopping at a breakpoint. You can use the | |
954 | @code{help} command at any time to find out more about @value{GDBN} commands. | |
955 | ||
956 | Remember, however, that @emph{operating system} facilities aren't | |
1d7c3357 RP |
957 | available on your development board; for example, if your program hangs, |
958 | you can't send an interrupt---but you can press the @sc{reset} switch! | |
18fae2a8 | 959 | |
1d7c3357 | 960 | Use the @sc{reset} button on the development board |
18fae2a8 RP |
961 | @itemize @bullet |
962 | @item | |
963 | to interrupt your program (don't use @kbd{ctl-C} on the DOS host---it has | |
1d7c3357 | 964 | no way to pass an interrupt signal to the development board); and |
18fae2a8 RP |
965 | |
966 | @item | |
967 | to return to the @value{GDBN} command prompt after your program finishes | |
968 | normally. The communications protocol provides no other way for @value{GDBN} | |
969 | to detect program completion. | |
970 | @end itemize | |
971 | ||
972 | In either case, @value{GDBN} will see the effect of a @sc{reset} on the | |
1d7c3357 | 973 | development board as a ``normal exit'' of your program. |
18fae2a8 | 974 | @end ifset |
a64a6c2b | 975 | @end ifset |
18fae2a8 | 976 | |
fe715d06 RP |
977 | @ifset SIMS |
978 | @node Simulator | |
979 | @subsection Simulated CPU target | |
18fae2a8 | 980 | |
fe715d06 RP |
981 | @ifset GENERIC |
982 | @cindex simulator | |
983 | @cindex simulator, Z8000 | |
fe715d06 | 984 | @cindex Z8000 simulator |
a64a6c2b | 985 | @cindex simulator, H8/300 or H8/500 |
1d7c3357 | 986 | @cindex H8/300 or H8/500 simulator |
a64a6c2b RP |
987 | @cindex simulator, Hitachi SH |
988 | @cindex Hitachi SH simulator | |
fe715d06 RP |
989 | @cindex CPU simulator |
990 | For some configurations, @value{GDBN} includes a CPU simulator that you | |
991 | can use instead of a hardware CPU to debug your programs. Currently, | |
992 | a simulator is available when @value{GDBN} is configured to debug Zilog | |
a64a6c2b | 993 | Z8000 or Hitachi microprocessor targets. |
fe715d06 RP |
994 | @end ifset |
995 | ||
996 | @ifclear GENERIC | |
a64a6c2b | 997 | @ifset H8 |
1d7c3357 RP |
998 | @cindex simulator, H8/300 or H8/500 |
999 | @cindex Hitachi H8/300 or H8/500 simulator | |
a64a6c2b RP |
1000 | @cindex simulator, Hitachi SH |
1001 | @cindex Hitachi SH simulator | |
1002 | When configured for debugging Hitachi microprocessor targets, | |
1003 | @value{GDBN} includes a CPU simulator for the target chip (a Hitachi SH, | |
1004 | H8/300, or H8/500). | |
fe715d06 RP |
1005 | @end ifset |
1006 | ||
a64a6c2b | 1007 | @ifset Z8K |
18fae2a8 RP |
1008 | @cindex simulator, Z8000 |
1009 | @cindex Zilog Z8000 simulator | |
e55d2728 RP |
1010 | When configured for debugging Zilog Z8000 targets, @value{GDBN} includes |
1011 | a Z8000 simulator. | |
fe715d06 RP |
1012 | @end ifset |
1013 | @end ifclear | |
1014 | ||
a64a6c2b | 1015 | @ifset Z8K |
fe715d06 RP |
1016 | For the Z8000 family, @samp{target sim} simulates either the Z8002 (the |
1017 | unsegmented variant of the Z8000 architecture) or the Z8001 (the | |
1018 | segmented variant). The simulator recognizes which architecture is | |
1019 | appropriate by inspecting the object code. | |
1020 | @end ifset | |
18fae2a8 RP |
1021 | |
1022 | @table @code | |
e55d2728 RP |
1023 | @item target sim |
1024 | @kindex sim | |
1025 | @kindex target sim | |
fe715d06 RP |
1026 | Debug programs on a simulated CPU |
1027 | @ifset GENERIC | |
1028 | (which CPU depends on the @value{GDBN} configuration) | |
1029 | @end ifset | |
18fae2a8 RP |
1030 | @end table |
1031 | ||
1032 | @noindent | |
fe715d06 RP |
1033 | After specifying this target, you can debug programs for the simulated |
1034 | CPU in the same style as programs for your host computer; use the | |
1035 | @code{file} command to load a new program image, the @code{run} command | |
1036 | to run your program, and so on. | |
18fae2a8 | 1037 | |
fe715d06 | 1038 | As well as making available all the usual machine registers (see |
18fae2a8 RP |
1039 | @code{info reg}), this debugging target provides three additional items |
1040 | of information as specially named registers: | |
1041 | ||
1042 | @table @code | |
1043 | @item cycles | |
1044 | Counts clock-ticks in the simulator. | |
1045 | ||
1046 | @item insts | |
1047 | Counts instructions run in the simulator. | |
1048 | ||
1049 | @item time | |
1050 | Execution time in 60ths of a second. | |
1051 | @end table | |
1052 | ||
1053 | You can refer to these values in @value{GDBN} expressions with the usual | |
1054 | conventions; for example, @w{@samp{b fputc if $cycles>5000}} sets a | |
1055 | conditional breakpoint that will suspend only after at least 5000 | |
1056 | simulated clock ticks. | |
1057 | @end ifset |