OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [doc/] [gdb.info-8] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 362 markom
This is ./gdb.info, produced by makeinfo version 4.0 from gdb.texinfo.
2 106 markom
 
3
INFO-DIR-SECTION Programming & development tools.
4
START-INFO-DIR-ENTRY
5
* Gdb: (gdb).                     The GNU debugger.
6
END-INFO-DIR-ENTRY
7
 
8
   This file documents the GNU debugger GDB.
9
 
10
   This is the Eighth Edition, March 2000, of `Debugging with GDB: the
11
GNU Source-Level Debugger' for GDB Version 5.0.
12
 
13
   Copyright (C) 1988-2000 Free Software Foundation, Inc.
14
 
15
   Permission is granted to make and distribute verbatim copies of this
16
manual provided the copyright notice and this permission notice are
17
preserved on all copies.
18
 
19
   Permission is granted to copy and distribute modified versions of
20
this manual under the conditions for verbatim copying, provided also
21
that the entire resulting derived work is distributed under the terms
22
of a permission notice identical to this one.
23
 
24
   Permission is granted to copy and distribute translations of this
25
manual into another language, under the above conditions for modified
26
versions.
27
 
28

29
File: gdb.info,  Node: VxWorks,  Up: Embedded OS
30
 
31
Using GDB with VxWorks
32
----------------------
33
 
34
`target vxworks MACHINENAME'
35
     A VxWorks system, attached via TCP/IP.  The argument MACHINENAME
36
     is the target system's machine name or IP address.
37
 
38
   On VxWorks, `load' links FILENAME dynamically on the current target
39
system as well as adding its symbols in GDB.
40
 
41
   GDB enables developers to spawn and debug tasks running on networked
42
VxWorks targets from a Unix host.  Already-running tasks spawned from
43
the VxWorks shell can also be debugged.  GDB uses code that runs on
44
both the Unix host and on the VxWorks target.  The program `gdb' is
45
installed and executed on the Unix host.  (It may be installed with the
46
name `vxgdb', to distinguish it from a GDB for debugging programs on
47
the host itself.)
48
 
49
`VxWorks-timeout ARGS'
50
     All VxWorks-based targets now support the option `vxworks-timeout'.
51
     This option is set by the user, and  ARGS represents the number of
52
     seconds GDB waits for responses to rpc's.  You might use this if
53
     your VxWorks target is a slow software simulator or is on the far
54
     side of a thin network line.
55
 
56
   The following information on connecting to VxWorks was current when
57
this manual was produced; newer releases of VxWorks may use revised
58
procedures.
59
 
60
   To use GDB with VxWorks, you must rebuild your VxWorks kernel to
61
include the remote debugging interface routines in the VxWorks library
62
`rdb.a'.  To do this, define `INCLUDE_RDB' in the VxWorks configuration
63
file `configAll.h' and rebuild your VxWorks kernel.  The resulting
64
kernel contains `rdb.a', and spawns the source debugging task
65
`tRdbTask' when VxWorks is booted.  For more information on configuring
66
and remaking VxWorks, see the manufacturer's manual.
67
 
68
   Once you have included `rdb.a' in your VxWorks system image and set
69
your Unix execution search path to find GDB, you are ready to run GDB.
70
From your Unix host, run `gdb' (or `vxgdb', depending on your
71
installation).
72
 
73
   GDB comes up showing the prompt:
74
 
75
     (vxgdb)
76
 
77
* Menu:
78
 
79
* VxWorks Connection::          Connecting to VxWorks
80
* VxWorks Download::            VxWorks download
81
* VxWorks Attach::              Running tasks
82
 
83

84
File: gdb.info,  Node: VxWorks Connection,  Next: VxWorks Download,  Up: VxWorks
85
 
86
Connecting to VxWorks
87
.....................
88
 
89
   The GDB command `target' lets you connect to a VxWorks target on the
90
network.  To connect to a target whose host name is "`tt'", type:
91
 
92
     (vxgdb) target vxworks tt
93
 
94
   GDB displays messages like these:
95
 
96
     Attaching remote machine across net...
97
     Connected to tt.
98
 
99
   GDB then attempts to read the symbol tables of any object modules
100
loaded into the VxWorks target since it was last booted.  GDB locates
101
these files by searching the directories listed in the command search
102
path (*note Your program's environment: Environment.); if it fails to
103
find an object file, it displays a message such as:
104
 
105
     prog.o: No such file or directory.
106
 
107
   When this happens, add the appropriate directory to the search path
108
with the GDB command `path', and execute the `target' command again.
109
 
110

111
File: gdb.info,  Node: VxWorks Download,  Next: VxWorks Attach,  Prev: VxWorks Connection,  Up: VxWorks
112
 
113
VxWorks download
114
................
115
 
116
   If you have connected to the VxWorks target and you want to debug an
117
object that has not yet been loaded, you can use the GDB `load' command
118
to download a file from Unix to VxWorks incrementally.  The object file
119
given as an argument to the `load' command is actually opened twice:
120
first by the VxWorks target in order to download the code, then by GDB
121
in order to read the symbol table.  This can lead to problems if the
122
current working directories on the two systems differ.  If both systems
123
have NFS mounted the same filesystems, you can avoid these problems by
124
using absolute paths.  Otherwise, it is simplest to set the working
125
directory on both systems to the directory in which the object file
126
resides, and then to reference the file by its name, without any path.
127
For instance, a program `prog.o' may reside in `VXPATH/vw/demo/rdb' in
128
VxWorks and in `HOSTPATH/vw/demo/rdb' on the host.  To load this
129
program, type this on VxWorks:
130
 
131
     -> cd "VXPATH/vw/demo/rdb"
132
 
133
Then, in GDB, type:
134
 
135
     (vxgdb) cd HOSTPATH/vw/demo/rdb
136
     (vxgdb) load prog.o
137
 
138
   GDB displays a response similar to this:
139
 
140
     Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
141
 
142
   You can also use the `load' command to reload an object module after
143
editing and recompiling the corresponding source file.  Note that this
144
makes GDB delete all currently-defined breakpoints, auto-displays, and
145
convenience variables, and to clear the value history.  (This is
146
necessary in order to preserve the integrity of debugger's data
147
structures that reference the target system's symbol table.)
148
 
149

150
File: gdb.info,  Node: VxWorks Attach,  Prev: VxWorks Download,  Up: VxWorks
151
 
152
Running tasks
153
.............
154
 
155
   You can also attach to an existing task using the `attach' command as
156
follows:
157
 
158
     (vxgdb) attach TASK
159
 
160
where TASK is the VxWorks hexadecimal task ID.  The task can be running
161
or suspended when you attach to it.  Running tasks are suspended at the
162
time of attachment.
163
 
164

165
File: gdb.info,  Node: Embedded Processors,  Next: Architectures,  Prev: Embedded OS,  Up: Configurations
166
 
167
Embedded Processors
168
===================
169
 
170
   This section goes into details specific to particular embedded
171
configurations.
172
 
173
* Menu:
174
 
175
* A29K Embedded::               AMD A29K Embedded
176
* ARM::                         ARM
177
* H8/300::                      Hitachi H8/300
178
* H8/500::                      Hitachi H8/500
179
* i960::                        Intel i960
180
* M32R/D::                      Mitsubishi M32R/D
181
* M68K::                        Motorola M68K
182
* M88K::                        Motorola M88K
183
* MIPS Embedded::               MIPS Embedded
184
* PA::                          HP PA Embedded
185
* PowerPC:                      PowerPC
186
* SH::                          Hitachi SH
187
* Sparclet::                    Tsqware Sparclet
188
* Sparclite::                   Fujitsu Sparclite
189
* ST2000::                      Tandem ST2000
190
* Z8000::                       Zilog Z8000
191
 
192

193
File: gdb.info,  Node: A29K Embedded,  Next: ARM,  Up: Embedded Processors
194
 
195
AMD A29K Embedded
196
-----------------
197
 
198
* Menu:
199
 
200
* A29K UDI::
201
* A29K EB29K::
202
* Comms (EB29K)::               Communications setup
203
* gdb-EB29K::                   EB29K cross-debugging
204
* Remote Log::                  Remote log
205
 
206
`target adapt DEV'
207
     Adapt monitor for A29K.
208
 
209
`target amd-eb DEV SPEED PROG'
210
     Remote PC-resident AMD EB29K board, attached over serial lines.
211
     DEV is the serial device, as for `target remote'; SPEED allows you
212
     to specify the linespeed; and PROG is the name of the program to
213
     be debugged, as it appears to DOS on the PC.  *Note EBMON protocol
214
     for AMD29K: A29K EB29K.
215
 
216

217
File: gdb.info,  Node: A29K UDI,  Next: A29K EB29K,  Up: A29K Embedded
218
 
219
A29K UDI
220
........
221
 
222
   GDB supports AMD's UDI ("Universal Debugger Interface") protocol for
223
debugging the a29k processor family.  To use this configuration with
224
AMD targets running the MiniMON monitor, you need the program `MONTIP',
225
available from AMD at no charge.  You can also use GDB with the
226
UDI-conformant a29k simulator program `ISSTIP', also available from AMD.
227
 
228
`target udi KEYWORD'
229
     Select the UDI interface to a remote a29k board or simulator, where
230
     KEYWORD is an entry in the AMD configuration file `udi_soc'.  This
231
     file contains keyword entries which specify parameters used to
232
     connect to a29k targets.  If the `udi_soc' file is not in your
233
     working directory, you must set the environment variable `UDICONF'
234
     to its pathname.
235
 
236

237
File: gdb.info,  Node: A29K EB29K,  Next: Comms (EB29K),  Prev: A29K UDI,  Up: A29K Embedded
238
 
239
EBMON protocol for AMD29K
240
.........................
241
 
242
   AMD distributes a 29K development board meant to fit in a PC,
243
together with a DOS-hosted monitor program called `EBMON'.  As a
244
shorthand term, this development system is called the "EB29K".  To use
245
GDB from a Unix system to run programs on the EB29K board, you must
246
first connect a serial cable between the PC (which hosts the EB29K
247
board) and a serial port on the Unix system.  In the following, we
248
assume you've hooked the cable between the PC's `COM1' port and
249
`/dev/ttya' on the Unix system.
250
 
251

252
File: gdb.info,  Node: Comms (EB29K),  Next: gdb-EB29K,  Prev: A29K EB29K,  Up: A29K Embedded
253
 
254
Communications setup
255
....................
256
 
257
   The next step is to set up the PC's port, by doing something like
258
this in DOS on the PC:
259
 
260
     C:\> MODE com1:9600,n,8,1,none
261
 
262
This example--run on an MS DOS 4.0 system--sets the PC port to 9600
263
bps, no parity, eight data bits, one stop bit, and no "retry" action;
264
you must match the communications parameters when establishing the Unix
265
end of the connection as well.
266
 
267
   To give control of the PC to the Unix side of the serial line, type
268
the following at the DOS console:
269
 
270
     C:\> CTTY com1
271
 
272
(Later, if you wish to return control to the DOS console, you can use
273
the command `CTTY con'--but you must send it over the device that had
274
control, in our example over the `COM1' serial line.)
275
 
276
   From the Unix host, use a communications program such as `tip' or
277
`cu' to communicate with the PC; for example,
278
 
279
     cu -s 9600 -l /dev/ttya
280
 
281
The `cu' options shown specify, respectively, the linespeed and the
282
serial port to use.  If you use `tip' instead, your command line may
283
look something like the following:
284
 
285
     tip -9600 /dev/ttya
286
 
287
Your system may require a different name where we show `/dev/ttya' as
288
the argument to `tip'.  The communications parameters, including which
289
port to use, are associated with the `tip' argument in the "remote"
290
descriptions file--normally the system table `/etc/remote'.
291
 
292
   Using the `tip' or `cu' connection, change the DOS working directory
293
to the directory containing a copy of your 29K program, then start the
294
PC program `EBMON' (an EB29K control program supplied with your board
295
by AMD).  You should see an initial display from `EBMON' similar to the
296
one that follows, ending with the `EBMON' prompt `#'--
297
 
298
     C:\> G:
299
 
300
     G:\> CD \usr\joe\work29k
301
 
302
     G:\USR\JOE\WORK29K> EBMON
303
     Am29000 PC Coprocessor Board Monitor, version 3.0-18
304
     Copyright 1990 Advanced Micro Devices, Inc.
305
     Written by Gibbons and Associates, Inc.
306
 
307
     Enter '?' or 'H' for help
308
 
309
     PC Coprocessor Type   = EB29K
310
     I/O Base              = 0x208
311
     Memory Base           = 0xd0000
312
 
313
     Data Memory Size      = 2048KB
314
     Available I-RAM Range = 0x8000 to 0x1fffff
315
     Available D-RAM Range = 0x80002000 to 0x801fffff
316
 
317
     PageSize              = 0x400
318
     Register Stack Size   = 0x800
319
     Memory Stack Size     = 0x1800
320
 
321
     CPU PRL               = 0x3
322
     Am29027 Available     = No
323
     Byte Write Available  = Yes
324
 
325
     # ~.
326
 
327
   Then exit the `cu' or `tip' program (done in the example by typing
328
`~.' at the `EBMON' prompt).  `EBMON' keeps running, ready for GDB to
329
take over.
330
 
331
   For this example, we've assumed what is probably the most convenient
332
way to make sure the same 29K program is on both the PC and the Unix
333
system: a PC/NFS connection that establishes "drive `G:'" on the PC as
334
a file system on the Unix host.  If you do not have PC/NFS or something
335
similar connecting the two systems, you must arrange some other
336
way--perhaps floppy-disk transfer--of getting the 29K program from the
337
Unix system to the PC; GDB does _not_ download it over the serial line.
338
 
339

340
File: gdb.info,  Node: gdb-EB29K,  Next: Remote Log,  Prev: Comms (EB29K),  Up: A29K Embedded
341
 
342
EB29K cross-debugging
343
.....................
344
 
345
   Finally, `cd' to the directory containing an image of your 29K
346
program on the Unix system, and start GDB--specifying as argument the
347
name of your 29K program:
348
 
349
     cd /usr/joe/work29k
350
     gdb myfoo
351
 
352
   Now you can use the `target' command:
353
 
354
     target amd-eb /dev/ttya 9600 MYFOO
355
 
356
In this example, we've assumed your program is in a file called
357
`myfoo'.  Note that the filename given as the last argument to `target
358
amd-eb' should be the name of the program as it appears to DOS.  In our
359
example this is simply `MYFOO', but in general it can include a DOS
360
path, and depending on your transfer mechanism may not resemble the
361
name on the Unix side.
362
 
363
   At this point, you can set any breakpoints you wish; when you are
364
ready to see your program run on the 29K board, use the GDB command
365
`run'.
366
 
367
   To stop debugging the remote program, use the GDB `detach' command.
368
 
369
   To return control of the PC to its console, use `tip' or `cu' once
370
again, after your GDB session has concluded, to attach to `EBMON'.  You
371
can then type the command `q' to shut down `EBMON', returning control
372
to the DOS command-line interpreter.  Type `CTTY con' to return command
373
input to the main DOS console, and type `~.' to leave `tip' or `cu'.
374
 
375

376
File: gdb.info,  Node: Remote Log,  Prev: gdb-EB29K,  Up: A29K Embedded
377
 
378
Remote log
379
..........
380
 
381
   The `target amd-eb' command creates a file `eb.log' in the current
382
working directory, to help debug problems with the connection.
383
`eb.log' records all the output from `EBMON', including echoes of the
384
commands sent to it.  Running `tail -f' on this file in another window
385
often helps to understand trouble with `EBMON', or unexpected events on
386
the PC side of the connection.
387
 
388

389
File: gdb.info,  Node: ARM,  Next: H8/300,  Prev: A29K Embedded,  Up: Embedded Processors
390
 
391
ARM
392
---
393
 
394
`target rdi DEV'
395
     ARM Angel monitor, via RDI library interface to ADP protocol.  You
396
     may use this target to communicate with both boards running the
397
     Angel monitor, or with the EmbeddedICE JTAG debug device.
398
 
399
`target rdp DEV'
400
     ARM Demon monitor.
401
 
402

403
File: gdb.info,  Node: H8/300,  Next: H8/500,  Prev: ARM,  Up: Embedded Processors
404
 
405
Hitachi H8/300
406
--------------
407
 
408
`target hms DEV'
409
     A Hitachi SH, H8/300, or H8/500 board, attached via serial line to
410
     your host.  Use special commands `device' and `speed' to control
411
     the serial line and the communications speed used.
412
 
413
`target e7000 DEV'
414
     E7000 emulator for Hitachi H8 and SH.
415
 
416
`target sh3 DEV'
417
`target sh3e DEV'
418
     Hitachi SH-3 and SH-3E target systems.
419
 
420
   When you select remote debugging to a Hitachi SH, H8/300, or H8/500
421
board, the `load' command downloads your program to the Hitachi board
422
and also opens it as the current executable target for GDB on your host
423
(like the `file' command).
424
 
425
   GDB needs to know these things to talk to your Hitachi SH, H8/300,
426
or H8/500:
427
 
428
  1. that you want to use `target hms', the remote debugging interface
429
     for Hitachi microprocessors, or `target e7000', the in-circuit
430
     emulator for the Hitachi SH and the Hitachi 300H.  (`target hms' is
431
     the default when GDB is configured specifically for the Hitachi SH,
432
     H8/300, or H8/500.)
433
 
434
  2. what serial device connects your host to your Hitachi board (the
435
     first serial device available on your host is the default).
436
 
437
  3. what speed to use over the serial device.
438
 
439
* Menu:
440
 
441
* Hitachi Boards::      Connecting to Hitachi boards.
442
* Hitachi ICE::         Using the E7000 In-Circuit Emulator.
443
* Hitachi Special::     Special GDB commands for Hitachi micros.
444
 
445

446
File: gdb.info,  Node: Hitachi Boards,  Next: Hitachi ICE,  Up: H8/300
447
 
448
Connecting to Hitachi boards
449
............................
450
 
451
   Use the special `GDB' command `device PORT' if you need to
452
explicitly set the serial device.  The default PORT is the first
453
available port on your host.  This is only necessary on Unix hosts,
454
where it is typically something like `/dev/ttya'.
455
 
456
   `GDB' has another special command to set the communications speed:
457
`speed BPS'.  This command also is only used from Unix hosts; on DOS
458
hosts, set the line speed as usual from outside GDB with the DOS `mode'
459
command (for instance, `mode com2:9600,n,8,1,p' for a 9600bps
460
connection).
461
 
462
   The `device' and `speed' commands are available only when you use a
463
Unix host to debug your Hitachi microprocessor programs.  If you use a
464
DOS host, GDB depends on an auxiliary terminate-and-stay-resident
465
program called `asynctsr' to communicate with the development board
466
through a PC serial port.  You must also use the DOS `mode' command to
467
set up the serial port on the DOS side.
468
 
469
   The following sample session illustrates the steps needed to start a
470
program under GDB control on an H8/300.  The example uses a sample
471
H8/300 program called `t.x'.  The procedure is the same for the Hitachi
472
SH and the H8/500.
473
 
474
   First hook up your development board.  In this example, we use a
475
board attached to serial port `COM2'; if you use a different serial
476
port, substitute its name in the argument of the `mode' command.  When
477
you call `asynctsr', the auxiliary comms program used by the debugger,
478
you give it just the numeric part of the serial port's name; for
479
example, `asyncstr 2' below runs `asyncstr' on `COM2'.
480
 
481
     C:\H8300\TEST> asynctsr 2
482
     C:\H8300\TEST> mode com2:9600,n,8,1,p
483
 
484
     Resident portion of MODE loaded
485
 
486
     COM2: 9600, n, 8, 1, p
487
 
488
     _Warning:_ We have noticed a bug in PC-NFS that conflicts with
489
     `asynctsr'.  If you also run PC-NFS on your DOS host, you may need
490
     to disable it, or even boot without it, to use `asynctsr' to
491
     control your development board.
492
 
493
   Now that serial communications are set up, and the development board
494
is connected, you can start up GDB.  Call `gdb' with the name of your
495
program as the argument.  `GDB' prompts you, as usual, with the prompt
496
`(gdb)'.  Use two special commands to begin your debugging session:
497
`target hms' to specify cross-debugging to the Hitachi board, and the
498
`load' command to download your program to the board.  `load' displays
499
the names of the program's sections, and a `*' for each 2K of data
500
downloaded.  (If you want to refresh GDB data on symbols or on the
501
executable file without downloading, use the GDB commands `file' or
502
`symbol-file'.  These commands, and `load' itself, are described in
503
*Note Commands to specify files: Files.)
504
 
505
     (eg-C:\H8300\TEST) gdb t.x
506
     GDB is free software and you are welcome to distribute copies
507
      of it under certain conditions; type "show copying" to see
508
      the conditions.
509
     There is absolutely no warranty for GDB; type "show warranty"
510
     for details.
511
     GDB 5.0, Copyright 1992 Free Software Foundation, Inc...
512
     (gdb) target hms
513
     Connected to remote H8/300 HMS system.
514
     (gdb) load t.x
515
     .text   : 0x8000 .. 0xabde ***********
516
     .data   : 0xabde .. 0xad30 *
517
     .stack  : 0xf000 .. 0xf014 *
518
 
519
   At this point, you're ready to run or debug your program.  From here
520
on, you can use all the usual GDB commands.  The `break' command sets
521
breakpoints; the `run' command starts your program; `print' or `x'
522
display data; the `continue' command resumes execution after stopping
523
at a breakpoint.  You can use the `help' command at any time to find
524
out more about GDB commands.
525
 
526
   Remember, however, that _operating system_ facilities aren't
527
available on your development board; for example, if your program hangs,
528
you can't send an interrupt--but you can press the RESET switch!
529
 
530
   Use the RESET button on the development board
531
   * to interrupt your program (don't use `ctl-C' on the DOS host--it
532
     has no way to pass an interrupt signal to the development board);
533
     and
534
 
535
   * to return to the GDB command prompt after your program finishes
536
     normally.  The communications protocol provides no other way for
537
     GDB to detect program completion.
538
 
539
   In either case, GDB sees the effect of a RESET on the development
540
board as a "normal exit" of your program.
541
 
542

543
File: gdb.info,  Node: Hitachi ICE,  Next: Hitachi Special,  Prev: Hitachi Boards,  Up: H8/300
544
 
545
Using the E7000 in-circuit emulator
546
...................................
547
 
548
   You can use the E7000 in-circuit emulator to develop code for either
549
the Hitachi SH or the H8/300H.  Use one of these forms of the `target
550
e7000' command to connect GDB to your E7000:
551
 
552
`target e7000 PORT SPEED'
553
     Use this form if your E7000 is connected to a serial port.  The
554
     PORT argument identifies what serial port to use (for example,
555
     `com2').  The third argument is the line speed in bits per second
556
     (for example, `9600').
557
 
558
`target e7000 HOSTNAME'
559
     If your E7000 is installed as a host on a TCP/IP network, you can
560
     just specify its hostname; GDB uses `telnet' to connect.
561
 
562

563
File: gdb.info,  Node: Hitachi Special,  Prev: Hitachi ICE,  Up: H8/300
564
 
565
Special GDB commands for Hitachi micros
566
.......................................
567
 
568
   Some GDB commands are available only for the H8/300:
569
 
570
`set machine h8300'
571
`set machine h8300h'
572
     Condition GDB for one of the two variants of the H8/300
573
     architecture with `set machine'.  You can use `show machine' to
574
     check which variant is currently in effect.
575
 
576

577
File: gdb.info,  Node: H8/500,  Next: i960,  Prev: H8/300,  Up: Embedded Processors
578
 
579
H8/500
580
------
581
 
582
`set memory MOD'
583
`show memory'
584
     Specify which H8/500 memory model (MOD) you are using with `set
585
     memory'; check which memory model is in effect with `show memory'.
586
     The accepted values for MOD are `small', `big', `medium', and
587
     `compact'.
588
 
589

590
File: gdb.info,  Node: i960,  Next: M32R/D,  Prev: H8/500,  Up: Embedded Processors
591
 
592
Intel i960
593
----------
594
 
595
`target mon960 DEV'
596
     MON960 monitor for Intel i960.
597
 
598
`target nindy DEVICENAME'
599
     An Intel 960 board controlled by a Nindy Monitor.  DEVICENAME is
600
     the name of the serial device to use for the connection, e.g.
601
     `/dev/ttya'.
602
 
603
   "Nindy" is a ROM Monitor program for Intel 960 target systems.  When
604
GDB is configured to control a remote Intel 960 using Nindy, you can
605
tell GDB how to connect to the 960 in several ways:
606
 
607
   * Through command line options specifying serial port, version of the
608
     Nindy protocol, and communications speed;
609
 
610
   * By responding to a prompt on startup;
611
 
612
   * By using the `target' command at any point during your GDB
613
     session.  *Note Commands for managing targets: Target Commands.
614
 
615
 
616
   With the Nindy interface to an Intel 960 board, `load' downloads
617
FILENAME to the 960 as well as adding its symbols in GDB.
618
 
619
* Menu:
620
 
621
* Nindy Startup::               Startup with Nindy
622
* Nindy Options::               Options for Nindy
623
* Nindy Reset::                 Nindy reset command
624
 
625

626
File: gdb.info,  Node: Nindy Startup,  Next: Nindy Options,  Up: i960
627
 
628
Startup with Nindy
629
..................
630
 
631
   If you simply start `gdb' without using any command-line options,
632
you are prompted for what serial port to use, _before_ you reach the
633
ordinary GDB prompt:
634
 
635
     Attach /dev/ttyNN -- specify NN, or "quit" to quit:
636
 
637
Respond to the prompt with whatever suffix (after `/dev/tty')
638
identifies the serial port you want to use.  You can, if you choose,
639
simply start up with no Nindy connection by responding to the prompt
640
with an empty line.  If you do this and later wish to attach to Nindy,
641
use `target' (*note Commands for managing targets: Target Commands.).
642
 
643

644
File: gdb.info,  Node: Nindy Options,  Next: Nindy Reset,  Prev: Nindy Startup,  Up: i960
645
 
646
Options for Nindy
647
.................
648
 
649
   These are the startup options for beginning your GDB session with a
650
Nindy-960 board attached:
651
 
652
`-r PORT'
653
     Specify the serial port name of a serial interface to be used to
654
     connect to the target system.  This option is only available when
655
     GDB is configured for the Intel 960 target architecture.  You may
656
     specify PORT as any of: a full pathname (e.g. `-r /dev/ttya'), a
657
     device name in `/dev' (e.g. `-r ttya'), or simply the unique
658
     suffix for a specific `tty' (e.g. `-r a').
659
 
660
`-O'
661
     (An uppercase letter "O", not a zero.)  Specify that GDB should use
662
     the "old" Nindy monitor protocol to connect to the target system.
663
     This option is only available when GDB is configured for the Intel
664
     960 target architecture.
665
 
666
          _Warning:_ if you specify `-O', but are actually trying to
667
          connect to a target system that expects the newer protocol,
668
          the connection fails, appearing to be a speed mismatch.  GDB
669
          repeatedly attempts to reconnect at several different line
670
          speeds.  You can abort this process with an interrupt.
671
 
672
`-brk'
673
     Specify that GDB should first send a `BREAK' signal to the target
674
     system, in an attempt to reset it, before connecting to a Nindy
675
     target.
676
 
677
          _Warning:_ Many target systems do not have the hardware that
678
          this requires; it only works with a few boards.
679
 
680
   The standard `-b' option controls the line speed used on the serial
681
port.
682
 
683

684
File: gdb.info,  Node: Nindy Reset,  Prev: Nindy Options,  Up: i960
685
 
686
Nindy reset command
687
...................
688
 
689
`reset'
690
     For a Nindy target, this command sends a "break" to the remote
691
     target system; this is only useful if the target has been equipped
692
     with a circuit to perform a hard reset (or some other interesting
693
     action) when a break is detected.
694
 
695

696
File: gdb.info,  Node: M32R/D,  Next: M68K,  Prev: i960,  Up: Embedded Processors
697
 
698
Mitsubishi M32R/D
699
-----------------
700
 
701
`target m32r DEV'
702
     Mitsubishi M32R/D ROM monitor.
703
 
704

705
File: gdb.info,  Node: M68K,  Next: M88K,  Prev: M32R/D,  Up: Embedded Processors
706
 
707
M68k
708
----
709
 
710
   The Motorola m68k configuration includes ColdFire support, and
711
target command for the following ROM monitors.
712
 
713
`target abug DEV'
714
     ABug ROM monitor for M68K.
715
 
716
`target cpu32bug DEV'
717
     CPU32BUG monitor, running on a CPU32 (M68K) board.
718
 
719
`target dbug DEV'
720
     dBUG ROM monitor for Motorola ColdFire.
721
 
722
`target est DEV'
723
     EST-300 ICE monitor, running on a CPU32 (M68K) board.
724
 
725
`target rom68k DEV'
726
     ROM 68K monitor, running on an M68K IDP board.
727
 
728
   If GDB is configured with `m68*-ericsson-*', it will instead have
729
only a single special target command:
730
 
731
`target es1800 DEV'
732
     ES-1800 emulator for M68K.
733
 
734
   [context?]
735
 
736
`target rombug DEV'
737
     ROMBUG ROM monitor for OS/9000.
738
 
739

740
File: gdb.info,  Node: M88K,  Next: MIPS Embedded,  Prev: M68K,  Up: Embedded Processors
741
 
742
M88K
743
----
744
 
745
`target bug DEV'
746
     BUG monitor, running on a MVME187 (m88k) board.
747
 
748

749
File: gdb.info,  Node: MIPS Embedded,  Next: PA,  Prev: M88K,  Up: Embedded Processors
750
 
751
MIPS Embedded
752
-------------
753
 
754
   GDB can use the MIPS remote debugging protocol to talk to a MIPS
755
board attached to a serial line.  This is available when you configure
756
GDB with `--target=mips-idt-ecoff'.
757
 
758
   Use these GDB commands to specify the connection to your target
759
board:
760
 
761
`target mips PORT'
762
     To run a program on the board, start up `gdb' with the name of
763
     your program as the argument.  To connect to the board, use the
764
     command `target mips PORT', where PORT is the name of the serial
765
     port connected to the board.  If the program has not already been
766
     downloaded to the board, you may use the `load' command to
767
     download it.  You can then use all the usual GDB commands.
768
 
769
     For example, this sequence connects to the target board through a
770
     serial port, and loads and runs a program called PROG through the
771
     debugger:
772
 
773
          host$ gdb PROG
774
          GDB is free software and ...
775
          (gdb) target mips /dev/ttyb
776
          (gdb) load PROG
777
          (gdb) run
778
 
779
`target mips HOSTNAME:PORTNUMBER'
780
     On some GDB host configurations, you can specify a TCP connection
781
     (for instance, to a serial line managed by a terminal
782
     concentrator) instead of a serial port, using the syntax
783
     `HOSTNAME:PORTNUMBER'.
784
 
785
`target pmon PORT'
786
     PMON ROM monitor.
787
 
788
`target ddb PORT'
789
     NEC's DDB variant of PMON for Vr4300.
790
 
791
`target lsi PORT'
792
     LSI variant of PMON.
793
 
794
`target r3900 DEV'
795
     Densan DVE-R3900 ROM monitor for Toshiba R3900 Mips.
796
 
797
`target array DEV'
798
     Array Tech LSI33K RAID controller board.
799
 
800
GDB also supports these special commands for MIPS targets:
801
 
802
`set processor ARGS'
803
`show processor'
804
     Use the `set processor' command to set the type of MIPS processor
805
     when you want to access processor-type-specific registers.  For
806
     example, `set processor R3041' tells GDB to use the CPO registers
807
     appropriate for the 3041 chip.  Use the `show processor' command
808
     to see what MIPS processor GDB is using.  Use the `info reg'
809
     command to see what registers GDB is using.
810
 
811
`set mipsfpu double'
812
`set mipsfpu single'
813
`set mipsfpu none'
814
`show mipsfpu'
815
     If your target board does not support the MIPS floating point
816
     coprocessor, you should use the command `set mipsfpu none' (if you
817
     need this, you may wish to put the command in your GDB init file).
818
     This tells GDB how to find the return value of functions which
819
     return floating point values.  It also allows GDB to avoid saving
820
     the floating point registers when calling functions on the board.
821
     If you are using a floating point coprocessor with only single
822
     precision floating point support, as on the R4650 processor, use
823
     the command `set mipsfpu single'.  The default double precision
824
     floating point coprocessor may be selected using `set mipsfpu
825
     double'.
826
 
827
     In previous versions the only choices were double precision or no
828
     floating point, so `set mipsfpu on' will select double precision
829
     and `set mipsfpu off' will select no floating point.
830
 
831
     As usual, you can inquire about the `mipsfpu' variable with `show
832
     mipsfpu'.
833
 
834
`set remotedebug N'
835
`show remotedebug'
836
     You can see some debugging information about communications with
837
     the board by setting the `remotedebug' variable.  If you set it to
838
     `1' using `set remotedebug 1', every packet is displayed.  If you
839
     set it to `2', every character is displayed.  You can check the
840
     current value at any time with the command `show remotedebug'.
841
 
842
`set timeout SECONDS'
843
`set retransmit-timeout SECONDS'
844
`show timeout'
845
`show retransmit-timeout'
846
     You can control the timeout used while waiting for a packet, in
847
     the MIPS remote protocol, with the `set timeout SECONDS' command.
848
     The default is 5 seconds.  Similarly, you can control the timeout
849
     used while waiting for an acknowledgement of a packet with the `set
850
     retransmit-timeout SECONDS' command.  The default is 3 seconds.
851
     You can inspect both values with `show timeout' and `show
852
     retransmit-timeout'.  (These commands are _only_ available when
853
     GDB is configured for `--target=mips-idt-ecoff'.)
854
 
855
     The timeout set by `set timeout' does not apply when GDB is
856
     waiting for your program to stop.  In that case, GDB waits forever
857
     because it has no way of knowing how long the program is going to
858
     run before stopping.
859
 
860

861
File: gdb.info,  Node: PowerPC,  Next: SH,  Prev: PA,  Up: Embedded Processors
862
 
863
PowerPC
864
-------
865
 
866
`target dink32 DEV'
867
     DINK32 ROM monitor.
868
 
869
`target ppcbug DEV'
870
 
871
`target ppcbug1 DEV'
872
     PPCBUG ROM monitor for PowerPC.
873
 
874
`target sds DEV'
875
     SDS monitor, running on a PowerPC board (such as Motorola's ADS).
876
 
877

878
File: gdb.info,  Node: PA,  Next: PowerPC,  Prev: MIPS Embedded,  Up: Embedded Processors
879
 
880
HP PA Embedded
881
--------------
882
 
883
`target op50n DEV'
884
     OP50N monitor, running on an OKI HPPA board.
885
 
886
`target w89k DEV'
887
     W89K monitor, running on a Winbond HPPA board.
888
 
889

890
File: gdb.info,  Node: SH,  Next: Sparclet,  Prev: PowerPC,  Up: Embedded Processors
891
 
892
Hitachi SH
893
----------
894
 
895
`target hms DEV'
896
     A Hitachi SH board attached via serial line to your host.  Use
897
     special commands `device' and `speed' to control the serial line
898
     and the communications speed used.
899
 
900
`target e7000 DEV'
901
     E7000 emulator for Hitachi SH.
902
 
903
`target sh3 DEV'
904
 
905
`target sh3e DEV'
906
     Hitachi SH-3 and SH-3E target systems.
907
 
908

909
File: gdb.info,  Node: Sparclet,  Next: Sparclite,  Prev: SH,  Up: Embedded Processors
910
 
911
Tsqware Sparclet
912
----------------
913
 
914
   GDB enables developers to debug tasks running on Sparclet targets
915
from a Unix host.  GDB uses code that runs on both the Unix host and on
916
the Sparclet target.  The program `gdb' is installed and executed on
917
the Unix host.
918
 
919
`remotetimeout ARGS'
920
     GDB supports the option `remotetimeout'.  This option is set by
921
     the user, and  ARGS represents the number of seconds GDB waits for
922
     responses.
923
 
924
   When compiling for debugging, include the options `-g' to get debug
925
information and `-Ttext' to relocate the program to where you wish to
926
load it on the target.  You may also want to add the options `-n' or
927
`-N' in order to reduce the size of the sections.  Example:
928
 
929
     sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N
930
 
931
   You can use `objdump' to verify that the addresses are what you
932
intended:
933
 
934
     sparclet-aout-objdump --headers --syms prog
935
 
936
   Once you have set your Unix execution search path to find GDB, you
937
are ready to run GDB.  From your Unix host, run `gdb' (or
938
`sparclet-aout-gdb', depending on your installation).
939
 
940
   GDB comes up showing the prompt:
941
 
942
     (gdbslet)
943
 
944
* Menu:
945
 
946
* Sparclet File::                Setting the file to debug
947
* Sparclet Connection::          Connecting to Sparclet
948
* Sparclet Download::            Sparclet download
949
* Sparclet Execution::           Running and debugging
950
 
951

952
File: gdb.info,  Node: Sparclet File,  Next: Sparclet Connection,  Up: Sparclet
953
 
954
Setting file to debug
955
.....................
956
 
957
   The GDB command `file' lets you choose with program to debug.
958
 
959
     (gdbslet) file prog
960
 
961
   GDB then attempts to read the symbol table of `prog'.  GDB locates
962
the file by searching the directories listed in the command search path.
963
If the file was compiled with debug information (option "-g"), source
964
files will be searched as well.  GDB locates the source files by
965
searching the directories listed in the directory search path (*note
966
Your program's environment: Environment.).  If it fails to find a file,
967
it displays a message such as:
968
 
969
     prog: No such file or directory.
970
 
971
   When this happens, add the appropriate directories to the search
972
paths with the GDB commands `path' and `dir', and execute the `target'
973
command again.
974
 
975

976
File: gdb.info,  Node: Sparclet Connection,  Next: Sparclet Download,  Prev: Sparclet File,  Up: Sparclet
977
 
978
Connecting to Sparclet
979
......................
980
 
981
   The GDB command `target' lets you connect to a Sparclet target.  To
982
connect to a target on serial port "`ttya'", type:
983
 
984
     (gdbslet) target sparclet /dev/ttya
985
     Remote target sparclet connected to /dev/ttya
986
     main () at ../prog.c:3
987
 
988
   GDB displays messages like these:
989
 
990
     Connected to ttya.
991
 
992

993
File: gdb.info,  Node: Sparclet Download,  Next: Sparclet Execution,  Prev: Sparclet Connection,  Up: Sparclet
994
 
995
Sparclet download
996
.................
997
 
998
   Once connected to the Sparclet target, you can use the GDB `load'
999
command to download the file from the host to the target.  The file
1000
name and load offset should be given as arguments to the `load' command.
1001
Since the file format is aout, the program must be loaded to the
1002
starting address.  You can use `objdump' to find out what this value
1003
is.  The load offset is an offset which is added to the VMA (virtual
1004
memory address) of each of the file's sections.  For instance, if the
1005
program `prog' was linked to text address 0x1201000, with data at
1006
0x12010160 and bss at 0x12010170, in GDB, type:
1007
 
1008
     (gdbslet) load prog 0x12010000
1009
     Loading section .text, size 0xdb0 vma 0x12010000
1010
 
1011
   If the code is loaded at a different address then what the program
1012
was linked to, you may need to use the `section' and `add-symbol-file'
1013
commands to tell GDB where to map the symbol table.
1014
 
1015

1016
File: gdb.info,  Node: Sparclet Execution,  Prev: Sparclet Download,  Up: Sparclet
1017
 
1018
Running and debugging
1019
.....................
1020
 
1021
   You can now begin debugging the task using GDB's execution control
1022
commands, `b', `step', `run', etc.  See the GDB manual for the list of
1023
commands.
1024
 
1025
     (gdbslet) b main
1026
     Breakpoint 1 at 0x12010000: file prog.c, line 3.
1027
     (gdbslet) run
1028
     Starting program: prog
1029
     Breakpoint 1, main (argc=1, argv=0xeffff21c) at prog.c:3
1030
     3        char *symarg = 0;
1031
     (gdbslet) step
1032
     4        char *execarg = "hello!";
1033
     (gdbslet)
1034
 
1035

1036
File: gdb.info,  Node: Sparclite,  Next: ST2000,  Prev: Sparclet,  Up: Embedded Processors
1037
 
1038
Fujitsu Sparclite
1039
-----------------
1040
 
1041
`target sparclite DEV'
1042
     Fujitsu sparclite boards, used only for the purpose of loading.
1043
     You must use an additional command to debug the program.  For
1044
     example: target remote DEV using GDB standard remote protocol.
1045
 
1046

1047
File: gdb.info,  Node: ST2000,  Next: Z8000,  Prev: Sparclite,  Up: Embedded Processors
1048
 
1049
Tandem ST2000
1050
-------------
1051
 
1052
   GDB may be used with a Tandem ST2000 phone switch, running Tandem's
1053
STDBUG protocol.
1054
 
1055
   To connect your ST2000 to the host system, see the manufacturer's
1056
manual.  Once the ST2000 is physically attached, you can run:
1057
 
1058
     target st2000 DEV SPEED
1059
 
1060
to establish it as your debugging environment.  DEV is normally the
1061
name of a serial device, such as `/dev/ttya', connected to the ST2000
1062
via a serial line.  You can instead specify DEV as a TCP connection
1063
(for example, to a serial line attached via a terminal concentrator)
1064
using the syntax `HOSTNAME:PORTNUMBER'.
1065
 
1066
   The `load' and `attach' commands are _not_ defined for this target;
1067
you must load your program into the ST2000 as you normally would for
1068
standalone operation.  GDB reads debugging information (such as
1069
symbols) from a separate, debugging version of the program available on
1070
your host computer.
1071
 
1072
   These auxiliary GDB commands are available to help you with the
1073
ST2000 environment:
1074
 
1075
`st2000 COMMAND'
1076
     Send a COMMAND to the STDBUG monitor.  See the manufacturer's
1077
     manual for available commands.
1078
 
1079
`connect'
1080
     Connect the controlling terminal to the STDBUG command monitor.
1081
     When you are done interacting with STDBUG, typing either of two
1082
     character sequences gets you back to the GDB command prompt:
1083
     `~.' (Return, followed by tilde and period) or `~'
1084
     (Return, followed by tilde and control-D).
1085
 
1086

1087
File: gdb.info,  Node: Z8000,  Prev: ST2000,  Up: Embedded Processors
1088
 
1089
Zilog Z8000
1090
-----------
1091
 
1092
   When configured for debugging Zilog Z8000 targets, GDB includes a
1093
Z8000 simulator.
1094
 
1095
   For the Z8000 family, `target sim' simulates either the Z8002 (the
1096
unsegmented variant of the Z8000 architecture) or the Z8001 (the
1097
segmented variant).  The simulator recognizes which architecture is
1098
appropriate by inspecting the object code.
1099
 
1100
`target sim ARGS'
1101
     Debug programs on a simulated CPU.  If the simulator supports setup
1102
     options, specify them via ARGS.
1103
 
1104
After specifying this target, you can debug programs for the simulated
1105
CPU in the same style as programs for your host computer; use the
1106
`file' command to load a new program image, the `run' command to run
1107
your program, and so on.
1108
 
1109
   As well as making available all the usual machine registers (*note
1110
Registers: Registers.), the Z8000 simulator provides three additional
1111
items of information as specially named registers:
1112
 
1113
`cycles'
1114
     Counts clock-ticks in the simulator.
1115
 
1116
`insts'
1117
     Counts instructions run in the simulator.
1118
 
1119
`time'
1120
     Execution time in 60ths of a second.
1121
 
1122
   You can refer to these values in GDB expressions with the usual
1123
conventions; for example, `b fputc if $cycles>5000' sets a conditional
1124
breakpoint that suspends only after at least 5000 simulated clock ticks.
1125
 
1126

1127
File: gdb.info,  Node: Architectures,  Prev: Embedded Processors,  Up: Configurations
1128
 
1129
Architectures
1130
=============
1131
 
1132
   This section describes characteristics of architectures that affect
1133
all uses of GDB with the architecture, both native and cross.
1134
 
1135
* Menu:
1136
 
1137
* A29K::
1138
* Alpha::
1139
* MIPS::
1140
 
1141

1142
File: gdb.info,  Node: A29K,  Next: Alpha,  Up: Architectures
1143
 
1144
A29K
1145
----
1146
 
1147
`set rstack_high_address ADDRESS'
1148
     On AMD 29000 family processors, registers are saved in a separate
1149
     "register stack".  There is no way for GDB to determine the extent
1150
     of this stack.  Normally, GDB just assumes that the stack is
1151
     "large enough".  This may result in GDB referencing memory
1152
     locations that do not exist.  If necessary, you can get around
1153
     this problem by specifying the ending address of the register
1154
     stack with the `set rstack_high_address' command.  The argument
1155
     should be an address, which you probably want to precede with `0x'
1156
     to specify in hexadecimal.
1157
 
1158
`show rstack_high_address'
1159
     Display the current limit of the register stack, on AMD 29000
1160
     family processors.
1161
 
1162

1163
File: gdb.info,  Node: Alpha,  Next: MIPS,  Prev: A29K,  Up: Architectures
1164
 
1165
Alpha
1166
-----
1167
 
1168
   See the following section.
1169
 
1170

1171
File: gdb.info,  Node: MIPS,  Prev: Alpha,  Up: Architectures
1172
 
1173
MIPS
1174
----
1175
 
1176
   Alpha- and MIPS-based computers use an unusual stack frame, which
1177
sometimes requires GDB to search backward in the object code to find
1178
the beginning of a function.
1179
 
1180
   To improve response time (especially for embedded applications, where
1181
GDB may be restricted to a slow serial line for this search) you may
1182
want to limit the size of this search, using one of these commands:
1183
 
1184
`set heuristic-fence-post LIMIT'
1185
     Restrict GDB to examining at most LIMIT bytes in its search for
1186
     the beginning of a function.  A value of 0 (the default) means
1187
     there is no limit.  However, except for 0, the larger the limit
1188
     the more bytes `heuristic-fence-post' must search and therefore
1189
     the longer it takes to run.
1190
 
1191
`show heuristic-fence-post'
1192
     Display the current limit.
1193
 
1194
These commands are available _only_ when GDB is configured for
1195
debugging programs on Alpha or MIPS processors.
1196
 
1197

1198
File: gdb.info,  Node: Controlling GDB,  Next: Sequences,  Prev: Configurations,  Up: Top
1199
 
1200
Controlling GDB
1201
***************
1202
 
1203
   You can alter the way GDB interacts with you by using the `set'
1204
command.  For commands controlling how GDB displays data, see *Note
1205
Print settings: Print Settings.  Other settings are described here.
1206
 
1207
* Menu:
1208
 
1209
* Prompt::                      Prompt
1210
* Editing::                     Command editing
1211
* History::                     Command history
1212
* Screen Size::                 Screen size
1213
* Numbers::                     Numbers
1214
* Messages/Warnings::           Optional warnings and messages
1215
* Debugging Output::            Optional messages about internal happenings
1216
 
1217

1218
File: gdb.info,  Node: Prompt,  Next: Editing,  Up: Controlling GDB
1219
 
1220
Prompt
1221
======
1222
 
1223
   GDB indicates its readiness to read a command by printing a string
1224
called the "prompt".  This string is normally `(gdb)'.  You can change
1225
the prompt string with the `set prompt' command.  For instance, when
1226
debugging GDB with GDB, it is useful to change the prompt in one of the
1227
GDB sessions so that you can always tell which one you are talking to.
1228
 
1229
   _Note:_  `set prompt' does not add a space for you after the prompt
1230
you set.  This allows you to set a prompt which ends in a space or a
1231
prompt that does not.
1232
 
1233
`set prompt NEWPROMPT'
1234
     Directs GDB to use NEWPROMPT as its prompt string henceforth.
1235
 
1236
`show prompt'
1237
     Prints a line of the form: `Gdb's prompt is: YOUR-PROMPT'
1238
 
1239

1240
File: gdb.info,  Node: Editing,  Next: History,  Prev: Prompt,  Up: Controlling GDB
1241
 
1242
Command editing
1243
===============
1244
 
1245
   GDB reads its input commands via the "readline" interface.  This GNU
1246
library provides consistent behavior for programs which provide a
1247
command line interface to the user.  Advantages are GNU Emacs-style or
1248
"vi"-style inline editing of commands, `csh'-like history substitution,
1249
and a storage and recall of command history across debugging sessions.
1250
 
1251
   You may control the behavior of command line editing in GDB with the
1252
command `set'.
1253
 
1254
`set editing'
1255
`set editing on'
1256
     Enable command line editing (enabled by default).
1257
 
1258
`set editing off'
1259
     Disable command line editing.
1260
 
1261
`show editing'
1262
     Show whether command line editing is enabled.
1263
 
1264

1265
File: gdb.info,  Node: History,  Next: Screen Size,  Prev: Editing,  Up: Controlling GDB
1266
 
1267
Command history
1268
===============
1269
 
1270
   GDB can keep track of the commands you type during your debugging
1271
sessions, so that you can be certain of precisely what happened.  Use
1272
these commands to manage the GDB command history facility.
1273
 
1274
`set history filename FNAME'
1275
     Set the name of the GDB command history file to FNAME.  This is
1276
     the file where GDB reads an initial command history list, and
1277
     where it writes the command history from this session when it
1278
     exits.  You can access this list through history expansion or
1279
     through the history command editing characters listed below.  This
1280
     file defaults to the value of the environment variable
1281
     `GDBHISTFILE', or to `./.gdb_history' (`./_gdb_history' on MS-DOS)
1282
     if this variable is not set.
1283
 
1284
`set history save'
1285
`set history save on'
1286
     Record command history in a file, whose name may be specified with
1287
     the `set history filename' command.  By default, this option is
1288
     disabled.
1289
 
1290
`set history save off'
1291
     Stop recording command history in a file.
1292
 
1293
`set history size SIZE'
1294
     Set the number of commands which GDB keeps in its history list.
1295
     This defaults to the value of the environment variable `HISTSIZE',
1296
     or to 256 if this variable is not set.
1297
 
1298
   History expansion assigns special meaning to the character `!'.
1299
 
1300
   Since `!' is also the logical not operator in C, history expansion
1301
is off by default. If you decide to enable history expansion with the
1302
`set history expansion on' command, you may sometimes need to follow
1303
`!' (when it is used as logical not, in an expression) with a space or
1304
a tab to prevent it from being expanded.  The readline history
1305
facilities do not attempt substitution on the strings `!=' and `!(',
1306
even when history expansion is enabled.
1307
 
1308
   The commands to control history expansion are:
1309
 
1310
`set history expansion on'
1311
`set history expansion'
1312
     Enable history expansion.  History expansion is off by default.
1313
 
1314
`set history expansion off'
1315
     Disable history expansion.
1316
 
1317
     The readline code comes with more complete documentation of
1318
     editing and history expansion features.  Users unfamiliar with GNU
1319
     Emacs or `vi' may wish to read it.
1320
 
1321
`show history'
1322
`show history filename'
1323
`show history save'
1324
`show history size'
1325
`show history expansion'
1326
     These commands display the state of the GDB history parameters.
1327
     `show history' by itself displays all four states.
1328
 
1329
`show commands'
1330
     Display the last ten commands in the command history.
1331
 
1332
`show commands N'
1333
     Print ten commands centered on command number N.
1334
 
1335
`show commands +'
1336
     Print ten commands just after the commands last printed.
1337
 
1338 362 markom

1339
File: gdb.info,  Node: Screen Size,  Next: Numbers,  Prev: History,  Up: Controlling GDB
1340
 
1341
Screen size
1342
===========
1343
 
1344
   Certain commands to GDB may produce large amounts of information
1345
output to the screen.  To help you read all of it, GDB pauses and asks
1346
you for input at the end of each page of output.  Type  when you
1347
want to continue the output, or `q' to discard the remaining output.
1348
Also, the screen width setting determines when to wrap lines of output.
1349
Depending on what is being printed, GDB tries to break the line at a
1350
readable place, rather than simply letting it overflow onto the
1351
following line.
1352
 
1353
   Normally GDB knows the size of the screen from the terminal driver
1354
software.  For example, on Unix GDB uses the termcap data base together
1355
with the value of the `TERM' environment variable and the `stty rows'
1356
and `stty cols' settings.  If this is not correct, you can override it
1357
with the `set height' and `set width' commands:
1358
 
1359
`set height LPP'
1360
`show height'
1361
`set width CPL'
1362
`show width'
1363
     These `set' commands specify a screen height of LPP lines and a
1364
     screen width of CPL characters.  The associated `show' commands
1365
     display the current settings.
1366
 
1367
     If you specify a height of zero lines, GDB does not pause during
1368
     output no matter how long the output is.  This is useful if output
1369
     is to a file or to an editor buffer.
1370
 
1371
     Likewise, you can specify `set width 0' to prevent GDB from
1372
     wrapping its output.
1373
 
1374

1375
File: gdb.info,  Node: Numbers,  Next: Messages/Warnings,  Prev: Screen Size,  Up: Controlling GDB
1376
 
1377
Numbers
1378
=======
1379
 
1380
   You can always enter numbers in octal, decimal, or hexadecimal in
1381
GDB by the usual conventions: octal numbers begin with `0', decimal
1382
numbers end with `.', and hexadecimal numbers begin with `0x'.  Numbers
1383
that begin with none of these are, by default, entered in base 10;
1384
likewise, the default display for numbers--when no particular format is
1385
specified--is base 10.  You can change the default base for both input
1386
and output with the `set radix' command.
1387
 
1388
`set input-radix BASE'
1389
     Set the default base for numeric input.  Supported choices for
1390
     BASE are decimal 8, 10, or 16.  BASE must itself be specified
1391
     either unambiguously or using the current default radix; for
1392
     example, any of
1393
 
1394
          set radix 012
1395
          set radix 10.
1396
          set radix 0xa
1397
 
1398
     sets the base to decimal.  On the other hand, `set radix 10'
1399
     leaves the radix unchanged no matter what it was.
1400
 
1401
`set output-radix BASE'
1402
     Set the default base for numeric display.  Supported choices for
1403
     BASE are decimal 8, 10, or 16.  BASE must itself be specified
1404
     either unambiguously or using the current default radix.
1405
 
1406
`show input-radix'
1407
     Display the current default base for numeric input.
1408
 
1409
`show output-radix'
1410
     Display the current default base for numeric display.
1411
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.