home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / gdb.info-6 < prev    next >
Encoding:
GNU Info File  |  1993-05-12  |  49.9 KB  |  1,297 lines

  1. This is Info file ./gdb.info, produced by Makeinfo-1.52 from the input
  2. file gdb.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Gdb: (gdb).                   The GNU debugger.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the GNU debugger GDB.
  8.  
  9.    This is Edition 4.09, April 1993, of `Debugging with GDB: the GNU
  10. Source-Level Debugger' for GDB Version 4.9.
  11.  
  12.    Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software
  13. 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 section entitled "GNU General Public License" is included
  22. exactly as in the original, and provided that the entire resulting
  23. derived work is distributed under the terms of a permission notice
  24. identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that the section entitled "GNU General Public License"
  29. may be included in a translation approved by the Free Software
  30. Foundation instead of in the original English.
  31.  
  32. 
  33. File: gdb.info,  Node: gdb-EB29K,  Next: Remote Log,  Prev: Comms (EB29K),  Up: EB29K Remote
  34.  
  35. EB29K cross-debugging
  36. ---------------------
  37.  
  38.    Finally, `cd' to the directory containing an image of your 29K
  39. program on the Unix system, and start GDB--specifying as argument the
  40. name of your 29K program:
  41.  
  42.      cd /usr/joe/work29k
  43.      gdb myfoo
  44.  
  45.    Now you can use the `target' command:
  46.  
  47.      target amd-eb /dev/ttya 9600 MYFOO
  48.  
  49. In this example, we've assumed your program is in a file called
  50. `myfoo'.  Note that the filename given as the last argument to `target
  51. amd-eb' should be the name of the program as it appears to DOS.  In our
  52. example this is simply `MYFOO', but in general it can include a DOS
  53. path, and depending on your transfer mechanism may not resemble the
  54. name on the Unix side.
  55.  
  56.    At this point, you can set any breakpoints you wish; when you are
  57. ready to see your program run on the 29K board, use the GDB command
  58. `run'.
  59.  
  60.    To stop debugging the remote program, use the GDB `detach' command.
  61.  
  62.    To return control of the PC to its console, use `tip' or `cu' once
  63. again, after your GDB session has concluded, to attach to `EBMON'.  You
  64. can then type the command `q' to shut down `EBMON', returning control
  65. to the DOS command-line interpreter.  Type `CTTY con' to return command
  66. input to the main DOS console, and type `~.' to leave `tip' or `cu'.
  67.  
  68. 
  69. File: gdb.info,  Node: Remote Log,  Prev: gdb-EB29K,  Up: EB29K Remote
  70.  
  71. Remote log
  72. ----------
  73.  
  74.    The `target amd-eb' command creates a file `eb.log' in the current
  75. working directory, to help debug problems with the connection.
  76. `eb.log' records all the output from `EBMON', including echoes of the
  77. commands sent to it.  Running `tail -f' on this file in another window
  78. often helps to understand trouble with `EBMON', or unexpected events on
  79. the PC side of the connection.
  80.  
  81. 
  82. File: gdb.info,  Node: ST2000 Remote,  Next: Hitachi Remote,  Prev: VxWorks Remote,  Up: Remote
  83.  
  84. GDB with a Tandem ST2000
  85. ------------------------
  86.  
  87.    To connect your ST2000 to the host system, see the manufacturer's
  88. manual.  Once the ST2000 is physically attached, you can run
  89.  
  90.      target st2000 DEV SPEED
  91.  
  92. to establish it as your debugging environment.
  93.  
  94.    The `load' and `attach' commands are *not* defined for this target;
  95. you must load your program into the ST2000 as you normally would for
  96. standalone operation.  GDB will read debugging information (such as
  97. symbols) from a separate, debugging version of the program available on
  98. your host computer.
  99.  
  100.    These auxiliary GDB commands are available to help you with the
  101. ST2000 environment:
  102.  
  103. `st2000 COMMAND'
  104.      Send a COMMAND to the STDBUG monitor.  See the manufacturer's
  105.      manual for available commands.
  106.  
  107. `connect'
  108.      Connect the controlling terminal to the STDBUG command monitor.
  109.      When you are done interacting with STDBUG, typing either of two
  110.      character sequences will get you back to the GDB command prompt:
  111.      `RET~.' (Return, followed by tilde and period) or `RET~C-d'
  112.      (Return, followed by tilde and control-D).
  113.  
  114. 
  115. File: gdb.info,  Node: VxWorks Remote,  Next: ST2000 Remote,  Prev: EB29K Remote,  Up: Remote
  116.  
  117. GDB and VxWorks
  118. ---------------
  119.  
  120.    GDB enables developers to spawn and debug tasks running on networked
  121. VxWorks targets from a Unix host.  Already-running tasks spawned from
  122. the VxWorks shell can also be debugged.  GDB uses code that runs on
  123. both the UNIX host and on the VxWorks target.  The program `gdb' is
  124. installed and executed on the UNIX host.
  125.  
  126.    The following information on connecting to VxWorks was current when
  127. this manual was produced; newer releases of VxWorks may use revised
  128. procedures.
  129.  
  130.    The remote debugging interface (RDB) routines are installed and
  131. executed on the VxWorks target.  These routines are included in the
  132. VxWorks library `rdb.a' and are incorporated into the system image when
  133. source-level debugging is enabled in the VxWorks configuration.
  134.  
  135.    If you wish, you can define `INCLUDE_RDB' in the VxWorks
  136. configuration file `configAll.h' to include the RDB interface routines
  137. and spawn the source debugging task `tRdbTask' when VxWorks is booted.
  138. For more information on configuring and remaking VxWorks, see the
  139. manufacturer's manual.
  140.  
  141.    Once you have included the RDB interface in your VxWorks system image
  142. and set your Unix execution search path to find GDB, you are ready to
  143. run GDB.  From your UNIX host, type:
  144.  
  145.      % gdb
  146.  
  147.    GDB will come up showing the prompt:
  148.  
  149.      (gdb)
  150.  
  151. * Menu:
  152.  
  153. * VxWorks Connection::          Connecting to VxWorks
  154. * VxWorks Download::            VxWorks download
  155. * VxWorks Attach::              Running tasks
  156.  
  157. 
  158. File: gdb.info,  Node: VxWorks Connection,  Next: VxWorks Download,  Up: VxWorks Remote
  159.  
  160. Connecting to VxWorks
  161. ---------------------
  162.  
  163.    The GDB command `target' lets you connect to a VxWorks target on the
  164. network.  To connect to a target whose host name is "`tt'", type:
  165.  
  166.      (gdb) target vxworks tt
  167.  
  168.    GDB will display a message similar to the following:
  169.  
  170.      Attaching remote machine across net... Success!
  171.  
  172.    GDB will then attempt to read the symbol tables of any object modules
  173. loaded into the VxWorks target since it was last booted.  GDB locates
  174. these files by searching the directories listed in the command search
  175. path (*note Your program's environment: Environment.); if it fails to
  176. find an object file, it will display a message such as:
  177.  
  178.      prog.o: No such file or directory.
  179.  
  180.    This will cause the `target' command to abort.  When this happens,
  181. you should add the appropriate directory to the search path, with the
  182. GDB command `path', and execute the `target' command again.
  183.  
  184. 
  185. File: gdb.info,  Node: VxWorks Download,  Next: VxWorks Attach,  Prev: VxWorks Connection,  Up: VxWorks Remote
  186.  
  187. VxWorks download
  188. ----------------
  189.  
  190.    If you have connected to the VxWorks target and you want to debug an
  191. object that has not yet been loaded, you can use the GDB `load' command
  192. to download a file from UNIX to VxWorks incrementally.  The object file
  193. given as an argument to the `load' command is actually opened twice:
  194. first by the VxWorks target in order to download the code, then by GDB
  195. in order to read the symbol table.  This can lead to problems if the
  196. current working directories on the two systems differ.  It is simplest
  197. to set the working directory on both systems to the directory in which
  198. the object file resides, and then to reference the file by its name,
  199. without any path.  Thus, to load a program `prog.o', residing in
  200. `wherever/vw/demo/rdb', on VxWorks type:
  201.  
  202.      -> cd "wherever/vw/demo/rdb"
  203.  
  204.    On GDB type:
  205.  
  206.      (gdb) cd wherever/vw/demo/rdb
  207.      (gdb) load prog.o
  208.  
  209.    GDB will display a response similar to the following:
  210.  
  211.      Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
  212.  
  213.    You can also use the `load' command to reload an object module after
  214. editing and recompiling the corresponding source file.  Note that this
  215. will cause GDB to delete all currently-defined breakpoints,
  216. auto-displays, and convenience variables, and to clear the value
  217. history.  (This is necessary in order to preserve the integrity of
  218. debugger data structures that reference the target system's symbol
  219. table.)
  220.  
  221. 
  222. File: gdb.info,  Node: VxWorks Attach,  Prev: VxWorks Download,  Up: VxWorks Remote
  223.  
  224. Running tasks
  225. -------------
  226.  
  227.    You can also attach to an existing task using the `attach' command as
  228. follows:
  229.  
  230.      (gdb) attach TASK
  231.  
  232. where TASK is the VxWorks hexadecimal task ID.  The task can be running
  233. or suspended when you attach to it.  If running, it will be suspended at
  234. the time of attachment.
  235.  
  236. 
  237. File: gdb.info,  Node: Hitachi Remote,  Next: MIPS Remote,  Prev: ST2000 Remote,  Up: Remote
  238.  
  239. GDB and Hitachi Microprocessors
  240. -------------------------------
  241.  
  242.    GDB needs to know these things to talk to your Hitachi SH, H8/300,
  243. or H8/500:
  244.  
  245.   1. that you want to use `target hms', the remote debugging interface
  246.      for Hitachi microprocessors (this is the default when GDB is
  247.      configured specifically for the Hitachi SH, H8/300, or H8/500);
  248.  
  249.   2. what serial device connects your host to your Hitachi board (the
  250.      first serial device available on your host is the default);
  251.  
  252.  
  253.    Use the special `gdb' command `device PORT' if you need to
  254. explicitly set the serial device.  The default PORT is the first
  255. available port on your host.  This is only necessary on Unix hosts,
  256. where it is typically something like `/dev/ttya'.
  257.  
  258.    `gdb' has another special command to set the communications speed:
  259. `speed BPS'.  This command also is only used from Unix hosts; on DOS
  260. hosts, set the line speed as usual from outside GDB with the DOS `mode'
  261. command (for instance, `mode com2:9600,n,8,1,p' for a 9600 bps
  262. connection).
  263.  
  264.    The `device' and `speed' commands are available only when you use a
  265. Unix host to debug your Hitachi microprocessor programs.  If you use a
  266. DOS host, GDB depends on an auxiliary terminate-and-stay-resident
  267. program called `asynctsr' to communicate with the development board
  268. through a PC serial port.  You must also use the DOS `mode' command to
  269. set up the serial port on the DOS side.
  270.  
  271. 
  272. File: gdb.info,  Node: MIPS Remote,  Next: Simulator,  Prev: Hitachi Remote,  Up: Remote
  273.  
  274. GDB and remote MIPS boards
  275. --------------------------
  276.  
  277.    GDB can use the MIPS remote debugging protocol to talk to a MIPS
  278. board attached to a serial line.  This is available when you configure
  279. GDB with `--target=mips-idt-ecoff'.
  280.  
  281.    To run a program on the board, start up `gdb' with the name of your
  282. program as the argument.  To connect to the board, use the command
  283. `target mips PORT', where PORT is the name of the serial port connected
  284. to the board.  If the program has not already been downloaded to the
  285. board, you may use the `load' command to download it.  You can then use
  286. all the usual GDB commands.
  287.  
  288.    You can see some debugging information about communications with the
  289. board by setting the `remotedebug' variable.  If you set it to 1 using
  290. `set remotedebug 1' every packet will be displayed.  If you set it to 2
  291. every character will be displayed.  You can check the current value at
  292. any time with the command `show remotedebug'.
  293.  
  294.    If your target board does not support the MIPS floating point
  295. coprocessor, you should use the command `set mipsfpu off' (you may wish
  296. to put this in your .gdbinit file).  This will tell GDB how to find the
  297. return value of functions which return floating point values, and tell
  298. it to call functions on the board without saving the floating point
  299. registers.
  300.  
  301. 
  302. File: gdb.info,  Node: Simulator,  Prev: MIPS Remote,  Up: Remote
  303.  
  304. Simulated CPU target
  305. --------------------
  306.  
  307.    For some configurations, GDB includes a CPU simulator that you can
  308. use instead of a hardware CPU to debug your programs.  Currently, a
  309. simulator is available when GDB is configured to debug Zilog Z8000 or
  310. Hitachi microprocessor targets.
  311.  
  312.    For the Z8000 family, `target sim' simulates either the Z8002 (the
  313. unsegmented variant of the Z8000 architecture) or the Z8001 (the
  314. segmented variant).  The simulator recognizes which architecture is
  315. appropriate by inspecting the object code.
  316.  
  317. `target sim'
  318.      Debug programs on a simulated CPU (which CPU depends on the GDB
  319.      configuration)
  320.  
  321. After specifying this target, you can debug programs for the simulated
  322. CPU in the same style as programs for your host computer; use the
  323. `file' command to load a new program image, the `run' command to run
  324. your program, and so on.
  325.  
  326.    As well as making available all the usual machine registers (see
  327. `info reg'), this debugging target provides three additional items of
  328. information as specially named registers:
  329.  
  330. `cycles'
  331.      Counts clock-ticks in the simulator.
  332.  
  333. `insts'
  334.      Counts instructions run in the simulator.
  335.  
  336. `time'
  337.      Execution time in 60ths of a second.
  338.  
  339.    You can refer to these values in GDB expressions with the usual
  340. conventions; for example, `b fputc if $cycles>5000' sets a conditional
  341. breakpoint that will suspend only after at least 5000 simulated clock
  342. ticks.
  343.  
  344. 
  345. File: gdb.info,  Node: Controlling GDB,  Next: Sequences,  Prev: Targets,  Up: Top
  346.  
  347. Controlling GDB
  348. ***************
  349.  
  350.    You can alter the way GDB interacts with you by using the `set'
  351. command.  For commands controlling how GDB displays data, *note Print
  352. settings: Print Settings.; other settings are described here.
  353.  
  354. * Menu:
  355.  
  356. * Prompt::                      Prompt
  357. * Editing::                     Command editing
  358. * History::                     Command history
  359. * Screen Size::                 Screen size
  360. * Numbers::                     Numbers
  361. * Messages/Warnings::           Optional warnings and messages
  362.  
  363. 
  364. File: gdb.info,  Node: Prompt,  Next: Editing,  Up: Controlling GDB
  365.  
  366. Prompt
  367. ======
  368.  
  369.    GDB indicates its readiness to read a command by printing a string
  370. called the "prompt".  This string is normally `(gdb)'.  You can change
  371. the prompt string with the `set prompt' command.  For instance, when
  372. debugging GDB with GDB, it is useful to change the prompt in one of the
  373. GDB sessions so that you can always tell which one you are talking to.
  374.  
  375. `set prompt NEWPROMPT'
  376.      Directs GDB to use NEWPROMPT as its prompt string henceforth.
  377.  
  378. `show prompt'
  379.      Prints a line of the form: `Gdb's prompt is: YOUR-PROMPT'
  380.  
  381. 
  382. File: gdb.info,  Node: Editing,  Next: History,  Prev: Prompt,  Up: Controlling GDB
  383.  
  384. Command editing
  385. ===============
  386.  
  387.    GDB reads its input commands via the "readline" interface.  This GNU
  388. library provides consistent behavior for programs which provide a
  389. command line interface to the user.  Advantages are `emacs'-style or
  390. `vi'-style inline editing of commands, `csh'-like history substitution,
  391. and a storage and recall of command history across debugging sessions.
  392.  
  393.    You may control the behavior of command line editing in GDB with the
  394. command `set'.
  395.  
  396. `set editing'
  397. `set editing on'
  398.      Enable command line editing (enabled by default).
  399.  
  400. `set editing off'
  401.      Disable command line editing.
  402.  
  403. `show editing'
  404.      Show whether command line editing is enabled.
  405.  
  406. 
  407. File: gdb.info,  Node: History,  Next: Screen Size,  Prev: Editing,  Up: Controlling GDB
  408.  
  409. Command history
  410. ===============
  411.  
  412.    GDB can keep track of the commands you type during your debugging
  413. sessions, so that you can be certain of precisely what happened.  Use
  414. these commands to manage the GDB command history facility.
  415.  
  416. `set history filename FNAME'
  417.      Set the name of the GDB command history file to FNAME.  This is
  418.      the file from which GDB will read an initial command history list
  419.      or to which it will write this list when it exits.  This list is
  420.      accessed through history expansion or through the history command
  421.      editing characters listed below.  This file defaults to the value
  422.      of the environment variable `GDBHISTFILE', or to `./.gdb_history'
  423.      if this variable is not set.
  424.  
  425. `set history save'
  426. `set history save on'
  427.      Record command history in a file, whose name may be specified with
  428.      the `set history filename' command.  By default, this option is
  429.      disabled.
  430.  
  431. `set history save off'
  432.      Stop recording command history in a file.
  433.  
  434. `set history size SIZE'
  435.      Set the number of commands which GDB will keep in its history list.
  436.      This defaults to the value of the environment variable `HISTSIZE',
  437.      or to 256 if this variable is not set.
  438.  
  439.    History expansion assigns special meaning to the character `!'.
  440.  
  441.    Since `!' is also the logical not operator in C, history expansion
  442. is off by default. If you decide to enable history expansion with the
  443. `set history expansion on' command, you may sometimes need to follow
  444. `!' (when it is used as logical not, in an expression) with a space or
  445. a tab to prevent it from being expanded.  The readline history
  446. facilities will not attempt substitution on the strings `!=' and `!(',
  447. even when history expansion is enabled.
  448.  
  449.    The commands to control history expansion are:
  450.  
  451. `set history expansion on'
  452. `set history expansion'
  453.      Enable history expansion.  History expansion is off by default.
  454.  
  455. `set history expansion off'
  456.      Disable history expansion.
  457.  
  458.      The readline code comes with more complete documentation of
  459.      editing and history expansion features.  Users unfamiliar with
  460.      `emacs' or `vi' may wish to read it.
  461.  
  462. `show history'
  463. `show history filename'
  464. `show history save'
  465. `show history size'
  466. `show history expansion'
  467.      These commands display the state of the GDB history parameters.
  468.      `show history' by itself displays all four states.
  469.  
  470. `show commands'
  471.      Display the last ten commands in the command history.
  472.  
  473. `show commands N'
  474.      Print ten commands centered on command number N.
  475.  
  476. `show commands +'
  477.      Print ten commands just after the commands last printed.
  478.  
  479. 
  480. File: gdb.info,  Node: Screen Size,  Next: Numbers,  Prev: History,  Up: Controlling GDB
  481.  
  482. Screen size
  483. ===========
  484.  
  485.    Certain commands to GDB may produce large amounts of information
  486. output to the screen.  To help you read all of it, GDB pauses and asks
  487. you for input at the end of each page of output.  Type RET when you
  488. want to continue the output, or `q' to discard the remaining output.
  489. Also, the screen width setting determines when to wrap lines of output.
  490. Depending on what is being printed, GDB tries to break the line at a
  491. readable place, rather than simply letting it overflow onto the
  492. following line.
  493.  
  494.    Normally GDB knows the size of the screen from the termcap data base
  495. together with the value of the `TERM' environment variable and the
  496. `stty rows' and `stty cols' settings. If this is not correct, you can
  497. override it with the `set height' and `set width' commands:
  498.  
  499. `set height LPP'
  500. `show height'
  501. `set width CPL'
  502. `show width'
  503.      These `set' commands specify a screen height of LPP lines and a
  504.      screen width of CPL characters.  The associated `show' commands
  505.      display the current settings.
  506.  
  507.      If you specify a height of zero lines, GDB will not pause during
  508.      output no matter how long the output is.  This is useful if output
  509.      is to a file or to an editor buffer.
  510.  
  511. 
  512. File: gdb.info,  Node: Numbers,  Next: Messages/Warnings,  Prev: Screen Size,  Up: Controlling GDB
  513.  
  514. Numbers
  515. =======
  516.  
  517.    You can always enter numbers in octal, decimal, or hexadecimal in
  518. GDB by the usual conventions: octal numbers begin with `0', decimal
  519. numbers end with `.', and hexadecimal numbers begin with `0x'.  Numbers
  520. that begin with none of these are, by default, entered in base 10;
  521. likewise, the default display for numbers--when no particular format is
  522. specified--is base 10.  You can change the default base for both input
  523. and output with the `set radix' command.
  524.  
  525. `set radix BASE'
  526.      Set the default base for numeric input and display.  Supported
  527.      choices for BASE are decimal 2, 8, 10, 16.  BASE must itself be
  528.      specified either unambiguously or using the current default radix;
  529.      for example, any of
  530.  
  531.           set radix 1010
  532.           set radix 012
  533.           set radix 10.
  534.           set radix 0xa
  535.  
  536.      will set the base to decimal.  On the other hand, `set radix 10'
  537.      will leave the radix unchanged no matter what it was.
  538.  
  539. `show radix'
  540.      Display the current default base for numeric input and display.
  541.  
  542. 
  543. File: gdb.info,  Node: Messages/Warnings,  Prev: Numbers,  Up: Controlling GDB
  544.  
  545. Optional warnings and messages
  546. ==============================
  547.  
  548.    By default, GDB is silent about its inner workings.  If you are
  549. running on a slow machine, you may want to use the `set verbose'
  550. command.  It will make GDB tell you when it does a lengthy internal
  551. operation, so you will not think it has crashed.
  552.  
  553.    Currently, the messages controlled by `set verbose' are those which
  554. announce that the symbol table for a source file is being read; see
  555. `symbol-file' in *Note Commands to specify files: Files.
  556.  
  557. `set verbose on'
  558.      Enables GDB output of certain informational messages.
  559.  
  560. `set verbose off'
  561.      Disables GDB output of certain informational messages.
  562.  
  563. `show verbose'
  564.      Displays whether `set verbose' is on or off.
  565.  
  566.    By default, if GDB encounters bugs in the symbol table of an object
  567. file, it is silent; but if you are debugging a compiler, you may find
  568. this information useful (*note Errors reading symbol files: Symbol
  569. Errors.).
  570.  
  571. `set complaints LIMIT'
  572.      Permits GDB to output LIMIT complaints about each type of unusual
  573.      symbols before becoming silent about the problem.  Set LIMIT to
  574.      zero to suppress all complaints; set it to a large number to
  575.      prevent complaints from being suppressed.
  576.  
  577. `show complaints'
  578.      Displays how many symbol complaints GDB is permitted to produce.
  579.  
  580.    By default, GDB is cautious, and asks what sometimes seems to be a
  581. lot of stupid questions to confirm certain commands.  For example, if
  582. you try to run a program which is already running:
  583.  
  584.      (gdb) run
  585.      The program being debugged has been started already.
  586.      Start it from the beginning? (y or n)
  587.  
  588.    If you are willing to unflinchingly face the consequences of your own
  589. commands, you can disable this "feature":
  590.  
  591. `set confirm off'
  592.      Disables confirmation requests.
  593.  
  594. `set confirm on'
  595.      Enables confirmation requests (the default).
  596.  
  597. `show confirm'
  598.      Displays state of confirmation requests.
  599.  
  600.    Some systems allow individual object files that make up your program
  601. to be replaced without stopping and restarting your program.  For
  602. example, in VxWorks you can simply recompile a defective object file
  603. and keep on running.  If you are running on one of these systems, you
  604. can allow GDB to reload the symbols for automatically relinked modules:
  605.  
  606. `set symbol-reloading on'
  607.      Replace symbol definitions for the corresponding source file when
  608.      an object file with a particular name is seen again.
  609.  
  610. `set symbol-reloading off'
  611.      Do not replace symbol definitions when re-encountering object
  612.      files of the same name.  This is the default state; if you are not
  613.      running on a system that permits automatically relinking modules,
  614.      you should leave `symbol-reloading' off, since otherwise GDB may
  615.      discard symbols when linking large programs, that may contain
  616.      several modules (from different directories or libraries) with the
  617.      same name.
  618.  
  619. `show symbol-reloading'
  620.      Show the current `on' or `off' setting.
  621.  
  622. 
  623. File: gdb.info,  Node: Sequences,  Next: Emacs,  Prev: Controlling GDB,  Up: Top
  624.  
  625. Canned Sequences of Commands
  626. ****************************
  627.  
  628.    Aside from breakpoint commands (*note Breakpoint command lists:
  629. Break Commands.), GDB provides two ways to store sequences of commands
  630. for execution as a unit: user-defined commands and command files.
  631.  
  632. * Menu:
  633.  
  634. * Define::                      User-defined commands
  635. * Hooks::            User-defined command hooks
  636. * Command Files::               Command files
  637. * Output::                      Commands for controlled output
  638.  
  639. 
  640. File: gdb.info,  Node: Define,  Next: Hooks,  Up: Sequences
  641.  
  642. User-defined commands
  643. =====================
  644.  
  645.    A "user-defined command" is a sequence of GDB commands to which you
  646. assign a new name as a command.  This is done with the `define' command.
  647.  
  648. `define COMMANDNAME'
  649.      Define a command named COMMANDNAME.  If there is already a command
  650.      by that name, you are asked to confirm that you want to redefine
  651.      it.
  652.  
  653.      The definition of the command is made up of other GDB command
  654.      lines, which are given following the `define' command.  The end of
  655.      these commands is marked by a line containing `end'.
  656.  
  657. `document COMMANDNAME'
  658.      Give documentation to the user-defined command COMMANDNAME.  The
  659.      command COMMANDNAME must already be defined.  This command reads
  660.      lines of documentation just as `define' reads the lines of the
  661.      command definition, ending with `end'.  After the `document'
  662.      command is finished, `help' on command COMMANDNAME will print the
  663.      documentation you have specified.
  664.  
  665.      You may use the `document' command again to change the
  666.      documentation of a command.  Redefining the command with `define'
  667.      does not change the documentation.
  668.  
  669. `help user-defined'
  670.      List all user-defined commands, with the first line of the
  671.      documentation (if any) for each.
  672.  
  673. `show user'
  674. `show user COMMANDNAME'
  675.      Display the GDB commands used to define COMMANDNAME (but not its
  676.      documentation).  If no COMMANDNAME is given, display the
  677.      definitions for all user-defined commands.
  678.  
  679.    User-defined commands do not take arguments.  When they are
  680. executed, the commands of the definition are not printed.  An error in
  681. any command stops execution of the user-defined command.
  682.  
  683.    Commands that would ask for confirmation if used interactively
  684. proceed without asking when used inside a user-defined command.  Many
  685. GDB commands that normally print messages to say what they are doing
  686. omit the messages when used in a user-defined command.
  687.  
  688. 
  689. File: gdb.info,  Node: Hooks,  Next: Command Files,  Prev: Define,  Up: Sequences
  690.  
  691. User-defined command hooks
  692. ==========================
  693.  
  694.    You may define *hooks*, which are a special kind of user-defined
  695. command.  Whenever you run the command `foo', if the user-defined
  696. command `hook-foo' exists, it is executed (with no arguments) before
  697. that command.
  698.  
  699.    In addition, a pseudo-command, `stop' exists.  Defining
  700. (`hook-stop') makes the associated commands execute every time
  701. execution stops in your program: before breakpoint commands are run,
  702. displays are printed, or the stack frame is printed.
  703.  
  704.    For example, to ignore `SIGALRM' signals while single-stepping, but
  705. treat them normally during normal execution, you could define:
  706.  
  707.      define hook-stop
  708.      handle SIGALRM nopass
  709.      end
  710.      
  711.      define hook-run
  712.      handle SIGALRM pass
  713.      end
  714.      
  715.      define hook-continue
  716.      handle SIGLARM pass
  717.      end
  718.  
  719.    You can define a hook for any single-word command in GDB, but not
  720. for command aliases; you should define a hook for the basic command
  721. name, e.g.  `backtrace' rather than `bt'.  If an error occurs during
  722. the execution of your hook, execution of GDB commands stops and GDB
  723. issues a prompt (before the command that you actually typed had a
  724. chance to run).
  725.  
  726.    If you try to define a hook which does not match any known command,
  727. you will get a warning from the `define' command.
  728.  
  729. 
  730. File: gdb.info,  Node: Command Files,  Next: Output,  Prev: Hooks,  Up: Sequences
  731.  
  732. Command files
  733. =============
  734.  
  735.    A command file for GDB is a file of lines that are GDB commands.
  736. Comments (lines starting with `#') may also be included.  An empty line
  737. in a command file does nothing; it does not mean to repeat the last
  738. command, as it would from the terminal.
  739.  
  740.    When you start GDB, it automatically executes commands from its
  741. "init files".  These are files named `.gdbinit'.  GDB reads the init
  742. file (if any) in your home directory and then the init file (if any) in
  743. the current working directory.  (The init files are not executed if you
  744. use the `-nx' option; *note Choosing modes: Mode Options..)
  745.  
  746.    On some configurations of GDB, the init file is known by a different
  747. name (these are typically environments where a specialized form of GDB
  748. may need to coexist with other forms, hence a different name for the
  749. specialized version's init file).  These are the environments with
  750. special init file names:
  751.  
  752.    * VxWorks (Wind River Systems real-time OS): `.vxgdbinit'
  753.  
  754.    * OS68K (Enea Data Systems real-time OS): `.os68gdbinit'
  755.  
  756.    * ES-1800 (Ericsson Telecom AB M68000 emulator): `.esgdbinit'
  757.  
  758.    You can also request the execution of a command file with the
  759. `source' command:
  760.  
  761. `source FILENAME'
  762.      Execute the command file FILENAME.
  763.  
  764.    The lines in a command file are executed sequentially.  They are not
  765. printed as they are executed.  An error in any command terminates
  766. execution of the command file.
  767.  
  768.    Commands that would ask for confirmation if used interactively
  769. proceed without asking when used in a command file.  Many GDB commands
  770. that normally print messages to say what they are doing omit the
  771. messages when called from command files.
  772.  
  773. 
  774. File: gdb.info,  Node: Output,  Prev: Command Files,  Up: Sequences
  775.  
  776. Commands for controlled output
  777. ==============================
  778.  
  779.    During the execution of a command file or a user-defined command,
  780. normal GDB output is suppressed; the only output that appears is what is
  781. explicitly printed by the commands in the definition.  This section
  782. describes three commands useful for generating exactly the output you
  783. want.
  784.  
  785. `echo TEXT'
  786.      Print TEXT.  Nonprinting characters can be included in TEXT using
  787.      C escape sequences, such as `\n' to print a newline.  *No newline
  788.      will be printed unless you specify one.* In addition to the
  789.      standard C escape sequences, a backslash followed by a space
  790.      stands for a space.  This is useful for displaying a string with
  791.      spaces at the beginning or the end, since leading and trailing
  792.      spaces are otherwise trimmed from all arguments.  To print ` and
  793.      foo = ', use the command `echo \ and foo = \ '.
  794.  
  795.      A backslash at the end of TEXT can be used, as in C, to continue
  796.      the command onto subsequent lines.  For example,
  797.  
  798.           echo This is some text\n\
  799.           which is continued\n\
  800.           onto several lines.\n
  801.  
  802.      produces the same output as
  803.  
  804.           echo This is some text\n
  805.           echo which is continued\n
  806.           echo onto several lines.\n
  807.  
  808. `output EXPRESSION'
  809.      Print the value of EXPRESSION and nothing but that value: no
  810.      newlines, no `$NN = '.  The value is not entered in the value
  811.      history either.  *Note Expressions: Expressions, for more
  812.      information on expressions.
  813.  
  814. `output/FMT EXPRESSION'
  815.      Print the value of EXPRESSION in format FMT.  You can use the same
  816.      formats as for `print'.  *Note Output formats: Output Formats, for
  817.      more information.
  818.  
  819. `printf STRING, EXPRESSIONS...'
  820.      Print the values of the EXPRESSIONS under the control of STRING.
  821.      The EXPRESSIONS are separated by commas and may be either numbers
  822.      or pointers.  Their values are printed as specified by STRING,
  823.      exactly as if your program were to execute
  824.  
  825.           printf (STRING, EXPRESSIONS...);
  826.  
  827.      For example, you can print two values in hex like this:
  828.  
  829.           printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
  830.  
  831.      The only backslash-escape sequences that you can use in the format
  832.      string are the simple ones that consist of backslash followed by a
  833.      letter.
  834.  
  835. 
  836. File: gdb.info,  Node: Emacs,  Next: GDB Bugs,  Prev: Sequences,  Up: Top
  837.  
  838. Using GDB under GNU Emacs
  839. *************************
  840.  
  841.    A special interface allows you to use GNU Emacs to view (and edit)
  842. the source files for the program you are debugging with GDB.
  843.  
  844.    To use this interface, use the command `M-x gdb' in Emacs.  Give the
  845. executable file you want to debug as an argument.  This command starts
  846. GDB as a subprocess of Emacs, with input and output through a newly
  847. created Emacs buffer.
  848.  
  849.    Using GDB under Emacs is just like using GDB normally except for two
  850. things:
  851.  
  852.    * All "terminal" input and output goes through the Emacs buffer.
  853.  
  854.    This applies both to GDB commands and their output, and to the input
  855. and output done by the program you are debugging.
  856.  
  857.    This is useful because it means that you can copy the text of
  858. previous commands and input them again; you can even use parts of the
  859. output in this way.
  860.  
  861.    All the facilities of Emacs' Shell mode are available for interacting
  862. with your program.  In particular, you can send signals the usual
  863. way--for example, `C-c C-c' for an interrupt, `C-c C-z' for a stop.
  864.  
  865.    * GDB displays source code through Emacs.
  866.  
  867.    Each time GDB displays a stack frame, Emacs automatically finds the
  868. source file for that frame and puts an arrow (`=>') at the left margin
  869. of the current line.  Emacs uses a separate buffer for source display,
  870. and splits the screen to show both your GDB session and the source.
  871.  
  872.    Explicit GDB `list' or search commands still produce output as
  873. usual, but you probably will have no reason to use them.
  874.  
  875.      *Warning:* If the directory where your program resides is not your
  876.      current directory, it can be easy to confuse Emacs about the
  877.      location of the source files, in which case the auxiliary display
  878.      buffer will not appear to show your source.  GDB can find programs
  879.      by searching your environment's `PATH' variable, so the GDB input
  880.      and output session will proceed normally; but Emacs does not get
  881.      enough information back from GDB to locate the source files in
  882.      this situation.  To avoid this problem, either start GDB mode from
  883.      the directory where your program resides, or specify a full path
  884.      name when prompted for the `M-x gdb' argument.
  885.  
  886.      A similar confusion can result if you use the GDB `file' command to
  887.      switch to debugging a program in some other location, from an
  888.      existing GDB buffer in Emacs.
  889.  
  890.    By default, `M-x gdb' calls the program called `gdb'.  If you need
  891. to call GDB by a different name (for example, if you keep several
  892. configurations around, with different names) you can set the Emacs
  893. variable `gdb-command-name'; for example,
  894.  
  895.      (setq gdb-command-name "mygdb")
  896.  
  897. (preceded by `ESC ESC', or typed in the `*scratch*' buffer, or in your
  898. `.emacs' file) will make Emacs call the program named "`mygdb'" instead.
  899.  
  900.    In the GDB I/O buffer, you can use these special Emacs commands in
  901. addition to the standard Shell mode commands:
  902.  
  903. `C-h m'
  904.      Describe the features of Emacs' GDB Mode.
  905.  
  906. `M-s'
  907.      Execute to another source line, like the GDB `step' command; also
  908.      update the display window to show the current file and location.
  909.  
  910. `M-n'
  911.      Execute to next source line in this function, skipping all function
  912.      calls, like the GDB `next' command.  Then update the display window
  913.      to show the current file and location.
  914.  
  915. `M-i'
  916.      Execute one instruction, like the GDB `stepi' command; update
  917.      display window accordingly.
  918.  
  919. `M-x gdb-nexti'
  920.      Execute to next instruction, using the GDB `nexti' command; update
  921.      display window accordingly.
  922.  
  923. `C-c C-f'
  924.      Execute until exit from the selected stack frame, like the GDB
  925.      `finish' command.
  926.  
  927. `M-c'
  928.      Continue execution of your program, like the GDB `continue'
  929.      command.
  930.  
  931.      *Warning:* In Emacs v19, this command is `C-c C-p'.
  932.  
  933. `M-u'
  934.      Go up the number of frames indicated by the numeric argument
  935.      (*note Numeric Arguments: (emacs)Arguments.), like the GDB `up'
  936.      command.
  937.  
  938.      *Warning:* In Emacs v19, this command is `C-c C-u'.
  939.  
  940. `M-d'
  941.      Go down the number of frames indicated by the numeric argument,
  942.      like the GDB `down' command.
  943.  
  944.      *Warning:* In Emacs v19, this command is `C-c C-d'.
  945.  
  946. `C-x &'
  947.      Read the number where the cursor is positioned, and insert it at
  948.      the end of the GDB I/O buffer.  For example, if you wish to
  949.      disassemble code around an address that was displayed earlier,
  950.      type `disassemble'; then move the cursor to the address display,
  951.      and pick up the argument for `disassemble' by typing `C-x &'.
  952.  
  953.      You can customize this further by defining elements of the list
  954.      `gdb-print-command'; once it is defined, you can format or
  955.      otherwise process numbers picked up by `C-x &' before they are
  956.      inserted.  A numeric argument to `C-x &' will both indicate that
  957.      you wish special formatting, and act as an index to pick an
  958.      element of the list.  If the list element is a string, the number
  959.      to be inserted is formatted using the Emacs function `format';
  960.      otherwise the number is passed as an argument to the corresponding
  961.      list element.
  962.  
  963.    In any source file, the Emacs command `C-x SPC' (`gdb-break') tells
  964. GDB to set a breakpoint on the source line point is on.
  965.  
  966.    If you accidentally delete the source-display buffer, an easy way to
  967. get it back is to type the command `f' in the GDB buffer, to request a
  968. frame display; when you run under Emacs, this will recreate the source
  969. buffer if necessary to show you the context of the current frame.
  970.  
  971.    The source files displayed in Emacs are in ordinary Emacs buffers
  972. which are visiting the source files in the usual way.  You can edit the
  973. files with these buffers if you wish; but keep in mind that GDB
  974. communicates with Emacs in terms of line numbers.  If you add or delete
  975. lines from the text, the line numbers that GDB knows will cease to
  976. correspond properly with the code.
  977.  
  978. 
  979. File: gdb.info,  Node: GDB Bugs,  Next: Renamed Commands,  Prev: Emacs,  Up: Top
  980.  
  981. Reporting Bugs in GDB
  982. *********************
  983.  
  984.    Your bug reports play an essential role in making GDB reliable.
  985.  
  986.    Reporting a bug may help you by bringing a solution to your problem,
  987. or it may not.  But in any case the principal function of a bug report
  988. is to help the entire community by making the next version of GDB work
  989. better.  Bug reports are your contribution to the maintenance of GDB.
  990.  
  991.    In order for a bug report to serve its purpose, you must include the
  992. information that enables us to fix the bug.
  993.  
  994. * Menu:
  995.  
  996. * Bug Criteria::                Have you found a bug?
  997. * Bug Reporting::               How to report bugs
  998.  
  999. 
  1000. File: gdb.info,  Node: Bug Criteria,  Next: Bug Reporting,  Up: GDB Bugs
  1001.  
  1002. Have you found a bug?
  1003. =====================
  1004.  
  1005.    If you are not sure whether you have found a bug, here are some
  1006. guidelines:
  1007.  
  1008.    * If the debugger gets a fatal signal, for any input whatever, that
  1009.      is a GDB bug.  Reliable debuggers never crash.
  1010.  
  1011.    * If GDB produces an error message for valid input, that is a bug.
  1012.  
  1013.    * If GDB does not produce an error message for invalid input, that
  1014.      is a bug.  However, you should note that your idea of "invalid
  1015.      input" might be our idea of "an extension" or "support for
  1016.      traditional practice".
  1017.  
  1018.    * If you are an experienced user of debugging tools, your suggestions
  1019.      for improvement of GDB are welcome in any case.
  1020.  
  1021. 
  1022. File: gdb.info,  Node: Bug Reporting,  Prev: Bug Criteria,  Up: GDB Bugs
  1023.  
  1024. How to report bugs
  1025. ==================
  1026.  
  1027.    A number of companies and individuals offer support for GNU products.
  1028. If you obtained GDB from a support organization, we recommend you
  1029. contact that organization first.
  1030.  
  1031.    You can find contact information for many support companies and
  1032. individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
  1033.  
  1034.    In any event, we also recommend that you send bug reports for GDB to
  1035. one of these addresses:
  1036.  
  1037.      bug-gdb@prep.ai.mit.edu
  1038.      {ucbvax|mit-eddie|uunet}!prep.ai.mit.edu!bug-gdb
  1039.  
  1040.    *Do not send bug reports to `info-gdb', or to `help-gdb', or to any
  1041. newsgroups.* Most users of GDB do not want to receive bug reports.
  1042. Those that do, have arranged to receive `bug-gdb'.
  1043.  
  1044.    The mailing list `bug-gdb' has a newsgroup `gnu.gdb.bug' which
  1045. serves as a repeater.  The mailing list and the newsgroup carry exactly
  1046. the same messages.  Often people think of posting bug reports to the
  1047. newsgroup instead of mailing them.  This appears to work, but it has one
  1048. problem which can be crucial: a newsgroup posting often lacks a mail
  1049. path back to the sender.  Thus, if we need to ask for more information,
  1050. we may be unable to reach you.  For this reason, it is better to send
  1051. bug reports to the mailing list.
  1052.  
  1053.    As a last resort, send bug reports on paper to:
  1054.  
  1055.      GNU Debugger Bugs
  1056.      Free Software Foundation
  1057.      545 Tech Square
  1058.      Cambridge, MA 02139
  1059.  
  1060.    The fundamental principle of reporting bugs usefully is this:
  1061. *report all the facts*.  If you are not sure whether to state a fact or
  1062. leave it out, state it!
  1063.  
  1064.    Often people omit facts because they think they know what causes the
  1065. problem and assume that some details do not matter.  Thus, you might
  1066. assume that the name of the variable you use in an example does not
  1067. matter.  Well, probably it does not, but one cannot be sure.  Perhaps
  1068. the bug is a stray memory reference which happens to fetch from the
  1069. location where that name is stored in memory; perhaps, if the name were
  1070. different, the contents of that location would fool the debugger into
  1071. doing the right thing despite the bug.  Play it safe and give a
  1072. specific, complete example.  That is the easiest thing for you to do,
  1073. and the most helpful.
  1074.  
  1075.    Keep in mind that the purpose of a bug report is to enable us to fix
  1076. the bug if it is new to us.  It is not as important as what happens if
  1077. the bug is already known.  Therefore, always write your bug reports on
  1078. the assumption that the bug has not been reported previously.
  1079.  
  1080.    Sometimes people give a few sketchy facts and ask, "Does this ring a
  1081. bell?"  Those bug reports are useless, and we urge everyone to *refuse
  1082. to respond to them* except to chide the sender to report bugs properly.
  1083.  
  1084.    To enable us to fix the bug, you should include all these things:
  1085.  
  1086.    * The version of GDB.  GDB announces it if you start with no
  1087.      arguments; you can also print it at any time using `show version'.
  1088.  
  1089.      Without this, we will not know whether there is any point in
  1090.      looking for the bug in the current version of GDB.
  1091.  
  1092.    * The type of machine you are using, and the operating system name
  1093.      and version number.
  1094.  
  1095.    * What compiler (and its version) was used to compile GDB--e.g.
  1096.      "gcc-2.0".
  1097.  
  1098.    * What compiler (and its version) was used to compile the program you
  1099.      are debugging--e.g.  "gcc-2.0".
  1100.  
  1101.    * The command arguments you gave the compiler to compile your
  1102.      example and observe the bug.  For example, did you use `-O'?  To
  1103.      guarantee you will not omit something important, list them all.  A
  1104.      copy of the Makefile (or the output from make) is sufficient.
  1105.  
  1106.      If we were to try to guess the arguments, we would probably guess
  1107.      wrong and then we might not encounter the bug.
  1108.  
  1109.    * A complete input script, and all necessary source files, that will
  1110.      reproduce the bug.
  1111.  
  1112.    * A description of what behavior you observe that you believe is
  1113.      incorrect.  For example, "It gets a fatal signal."
  1114.  
  1115.      Of course, if the bug is that GDB gets a fatal signal, then we will
  1116.      certainly notice it.  But if the bug is incorrect output, we might
  1117.      not notice unless it is glaringly wrong.  We are human, after all.
  1118.      You might as well not give us a chance to make a mistake.
  1119.  
  1120.      Even if the problem you experience is a fatal signal, you should
  1121.      still say so explicitly.  Suppose something strange is going on,
  1122.      such as, your copy of GDB is out of synch, or you have encountered
  1123.      a bug in the C library on your system.  (This has happened!)  Your
  1124.      copy might crash and ours would not.  If you told us to expect a
  1125.      crash, then when ours fails to crash, we would know that the bug
  1126.      was not happening for us.  If you had not told us to expect a
  1127.      crash, then we would not be able to draw any conclusion from our
  1128.      observations.
  1129.  
  1130.    * If you wish to suggest changes to the GDB source, send us context
  1131.      diffs.  If you even discuss something in the GDB source, refer to
  1132.      it by context, not by line number.
  1133.  
  1134.      The line numbers in our development sources will not match those
  1135.      in your sources.  Your line numbers would convey no useful
  1136.      information to us.
  1137.  
  1138.    Here are some things that are not necessary:
  1139.  
  1140.    * A description of the envelope of the bug.
  1141.  
  1142.      Often people who encounter a bug spend a lot of time investigating
  1143.      which changes to the input file will make the bug go away and which
  1144.      changes will not affect it.
  1145.  
  1146.      This is often time consuming and not very useful, because the way
  1147.      we will find the bug is by running a single example under the
  1148.      debugger with breakpoints, not by pure deduction from a series of
  1149.      examples.  We recommend that you save your time for something else.
  1150.  
  1151.      Of course, if you can find a simpler example to report *instead*
  1152.      of the original one, that is a convenience for us.  Errors in the
  1153.      output will be easier to spot, running under the debugger will take
  1154.      less time, etc.
  1155.  
  1156.      However, simplification is not vital; if you do not want to do
  1157.      this, report the bug anyway and send us the entire test case you
  1158.      used.
  1159.  
  1160.    * A patch for the bug.
  1161.  
  1162.      A patch for the bug does help us if it is a good one.  But do not
  1163.      omit the necessary information, such as the test case, on the
  1164.      assumption that a patch is all we need.  We might see problems
  1165.      with your patch and decide to fix the problem another way, or we
  1166.      might not understand it at all.
  1167.  
  1168.      Sometimes with a program as complicated as GDB it is very hard to
  1169.      construct an example that will make the program follow a certain
  1170.      path through the code.  If you do not send us the example, we will
  1171.      not be able to construct one, so we will not be able to verify
  1172.      that the bug is fixed.
  1173.  
  1174.      And if we cannot understand what bug you are trying to fix, or why
  1175.      your patch should be an improvement, we will not install it.  A
  1176.      test case will help us to understand.
  1177.  
  1178.    * A guess about what the bug is or what it depends on.
  1179.  
  1180.      Such guesses are usually wrong.  Even we cannot guess right about
  1181.      such things without first using the debugger to find the facts.
  1182.  
  1183. 
  1184. File: gdb.info,  Node: Renamed Commands,  Next: Formatting Documentation,  Prev: GDB Bugs,  Up: Top
  1185.  
  1186. Renamed Commands
  1187. ****************
  1188.  
  1189.    The following commands were renamed in GDB 4, in order to make the
  1190. command set as a whole more consistent and easier to use and remember:
  1191.  
  1192.      OLD COMMAND               NEW COMMAND
  1193.      ---------------           -------------------------------
  1194.      add-syms                  add-symbol-file
  1195.      delete environment        unset environment
  1196.      info convenience          show convenience
  1197.      info copying              show copying
  1198.      info directories          show directories
  1199.      info editing              show commands
  1200.      info history              show values
  1201.      info targets              help target
  1202.      info values               show values
  1203.      info version              show version
  1204.      info warranty             show warranty
  1205.      set/show addressprint     set/show print address
  1206.      set/show array-max        set/show print elements
  1207.      set/show arrayprint       set/show print array
  1208.      set/show asm-demangle     set/show print asm-demangle
  1209.      set/show caution          set/show confirm
  1210.      set/show demangle         set/show print demangle
  1211.      set/show history write    set/show history save
  1212.      set/show prettyprint      set/show print pretty
  1213.      set/show screen-height    set/show height
  1214.      set/show screen-width     set/show width
  1215.      set/show sevenbit-strings set/show print sevenbit-strings
  1216.      set/show unionprint       set/show print union
  1217.      set/show vtblprint        set/show print vtbl
  1218.      
  1219.      unset                     [No longer an alias for delete]
  1220.  
  1221. 
  1222. File: gdb.info,  Node: Formatting Documentation,  Next: Installing GDB,  Prev: Renamed Commands,  Up: Top
  1223.  
  1224. Formatting Documentation
  1225. ************************
  1226.  
  1227.    The GDB 4 release includes an already-formatted reference card, ready
  1228. for printing with PostScript or GhostScript, in the `gdb' subdirectory
  1229. of the main source directory(1).  If you can use PostScript or
  1230. GhostScript with your printer, you can print the reference card
  1231. immediately with `refcard.ps'.
  1232.  
  1233.    The release also includes the source for the reference card.  You
  1234. can format it, using TeX, by typing:
  1235.  
  1236.      make refcard.dvi
  1237.  
  1238.    The GDB reference card is designed to print in landscape mode on US
  1239. "letter" size paper; that is, on a sheet 11 inches wide by 8.5 inches
  1240. high.  You will need to specify this form of printing as an option to
  1241. your DVI output program.
  1242.  
  1243.    All the documentation for GDB comes as part of the machine-readable
  1244. distribution.  The documentation is written in Texinfo format, which is
  1245. a documentation system that uses a single source file to produce both
  1246. on-line information and a printed manual.  You can use one of the Info
  1247. formatting commands to create the on-line version of the documentation
  1248. and TeX (or `texi2roff') to typeset the printed version.
  1249.  
  1250.    GDB includes an already formatted copy of the on-line Info version of
  1251. this manual in the `gdb' subdirectory.  The main Info file is
  1252. `gdb-VERSION-NUMBER/gdb/gdb.info', and it refers to subordinate files
  1253. matching `gdb.info*' in the same directory.  If necessary, you can
  1254. print out these files, or read them with any editor; but they are
  1255. easier to read using the `info' subsystem in GNU Emacs or the
  1256. standalone `info' program, available as part of the GNU Texinfo
  1257. distribution.
  1258.  
  1259.    If you want to format these Info files yourself, you need one of the
  1260. Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'.
  1261.  
  1262.    If you have `makeinfo' installed, and are in the top level GDB
  1263. source directory (`gdb-4.9', in the case of version 4.9), you can make
  1264. the Info file by typing:
  1265.  
  1266.      cd gdb
  1267.      make gdb.info
  1268.  
  1269.    If you want to typeset and print copies of this manual, you need TeX,
  1270. a program to print its DVI output files, and `texinfo.tex', the Texinfo
  1271. definitions file.
  1272.  
  1273.    TeX is a typesetting program; it does not print files directly, but
  1274. produces output files called DVI files.  To print a typeset document,
  1275. you need a program to print DVI files.  If your system has TeX
  1276. installed, chances are it has such a program.  The precise command to
  1277. use depends on your system; `lpr -d' is common; another (for PostScript
  1278. devices) is `dvips'.  The DVI print command may require a file name
  1279. without any extension or a `.dvi' extension.
  1280.  
  1281.    TeX also requires a macro definitions file called `texinfo.tex'.
  1282. This file tells TeX how to typeset a document written in Texinfo
  1283. format.  On its own, TeX cannot read, much less typeset a Texinfo file.
  1284. `texinfo.tex' is distributed with GDB and is located in the
  1285. `gdb-VERSION-NUMBER/texinfo' directory.
  1286.  
  1287.    If you have TeX and a DVI printer program installed, you can typeset
  1288. and print this manual.  First switch to the the `gdb' subdirectory of
  1289. the main source directory (for example, to `gdb-4.9/gdb') and then type:
  1290.  
  1291.      make gdb.dvi
  1292.  
  1293.    ---------- Footnotes ----------
  1294.  
  1295.    (1)  In `gdb-4.9/gdb/refcard.ps' of the version 4.9 release.
  1296.  
  1297.