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-4 < prev    next >
Encoding:
GNU Info File  |  1993-05-12  |  49.3 KB  |  1,351 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: Registers,  Next: Floating Point Hardware,  Prev: Convenience Vars,  Up: Data
  34.  
  35. Registers
  36. =========
  37.  
  38.    You can refer to machine register contents, in expressions, as
  39. variables with names starting with `$'.  The names of registers are
  40. different for each machine; use `info registers' to see the names used
  41. on your machine.
  42.  
  43. `info registers'
  44.      Print the names and values of all registers except floating-point
  45.      registers (in the selected stack frame).
  46.  
  47. `info all-registers'
  48.      Print the names and values of all registers, including
  49.      floating-point registers.
  50.  
  51. `info registers REGNAME ...'
  52.      Print the relativized value of each specified register REGNAME.
  53.      rEGNAME may be any register name valid on the machine you are
  54.      using, with or without the initial `$'.
  55.  
  56.    GDB has four "standard" register names that are available (in
  57. expressions) on most machines--whenever they do not conflict with an
  58. architecture's canonical mnemonics for registers.  The register names
  59. `$pc' and `$sp' are used for the program counter register and the stack
  60. pointer.  `$fp' is used for a register that contains a pointer to the
  61. current stack frame, and `$ps' is used for a register that contains the
  62. processor status.  For example, you could print the program counter in
  63. hex with
  64.  
  65.      p/x $pc
  66.  
  67. or print the instruction to be executed next with
  68.  
  69.      x/i $pc
  70.  
  71. or add four to the stack pointer(1) with
  72.  
  73.      set $sp += 4
  74.  
  75.    Whenever possible, these four standard register names are available
  76. on your machine even though the machine has different canonical
  77. mnemonics, so long as there is no conflict.  The `info registers'
  78. command shows the canonical names.  For example, on the SPARC, `info
  79. registers' displays the processor status register as `$psr' but you can
  80. also refer to it as `$ps'.
  81.  
  82.    GDB always considers the contents of an ordinary register as an
  83. integer when the register is examined in this way.  Some machines have
  84. special registers which can hold nothing but floating point; these
  85. registers are considered to have floating point values.  There is no way
  86. to refer to the contents of an ordinary register as floating point value
  87. (although you can *print* it as a floating point value with `print/f
  88. $REGNAME').
  89.  
  90.    Some registers have distinct "raw" and "virtual" data formats.  This
  91. means that the data format in which the register contents are saved by
  92. the operating system is not the same one that your program normally
  93. sees.  For example, the registers of the 68881 floating point
  94. coprocessor are always saved in "extended" (raw) format, but all C
  95. programs expect to work with "double" (virtual) format.  In such cases,
  96. GDB normally works with the virtual format only (the format that makes
  97. sense for your program), but the `info registers' command prints the
  98. data in both formats.
  99.  
  100.    Normally, register values are relative to the selected stack frame
  101. (*note Selecting a frame: Selection.).  This means that you get the
  102. value that the register would contain if all stack frames farther in
  103. were exited and their saved registers restored.  In order to see the
  104. true contents of hardware registers, you must select the innermost
  105. frame (with `frame 0').
  106.  
  107.    However, GDB must deduce where registers are saved, from the machine
  108. code generated by your compiler.  If some registers are not saved, or if
  109. GDB is unable to locate the saved registers, the selected stack frame
  110. will make no difference.
  111.  
  112. `set rstack_high_address ADDRESS'
  113.      On AMD 29000 family processors, registers are saved in a separate
  114.      "register stack".  There is no way for GDB to determine the extent
  115.      of this stack.  Normally, GDB just assumes that the stack is "large
  116.      enough".  This may result in GDB referencing memory locations that
  117.      do not exist.  If necessary, you can get around this problem by
  118.      specifying the ending address of the register stack with the `set
  119.      rstack_high_address' command.  The argument should be an address,
  120.      which you will probably want to precede with `0x' to specify in
  121.      hexadecimal.
  122.  
  123. `show rstack_high_address'
  124.      Display the current limit of the register stack, on AMD 29000
  125.      family processors.
  126.  
  127.    ---------- Footnotes ----------
  128.  
  129.    (1)  This is a way of removing one word from the stack, on machines
  130. where stacks grow downward in memory (most machines, nowadays).  This
  131. assumes that the innermost stack frame is selected; setting `$sp' is
  132. not allowed when other stack frames are selected.  To pop entire frames
  133. off the stack, regardless of machine architecture, use `return'; *note
  134. Returning from a function: Returning..
  135.  
  136. 
  137. File: gdb.info,  Node: Floating Point Hardware,  Prev: Registers,  Up: Data
  138.  
  139. Floating point hardware
  140. =======================
  141.  
  142.    Depending on the host machine architecture, GDB may be able to give
  143. you more information about the status of the floating point hardware.
  144.  
  145. `info float'
  146.      Display hardware-dependent information about the floating point
  147.      unit.  The exact contents and layout vary depending on the
  148.      floating point chip; on some platforms, `info float' is not
  149.      available at all.
  150.  
  151. 
  152. File: gdb.info,  Node: Languages,  Next: Symbols,  Prev: Data,  Up: Top
  153.  
  154. Using GDB with Different Languages
  155. **********************************
  156.  
  157.    Although programming languages generally have common aspects, they
  158. are rarely expressed in the same manner.  For instance, in ANSI C,
  159. dereferencing a pointer `p' is accomplished by `*p', but in Modula-2,
  160. it is accomplished by `p^'.  Values can also be represented (and
  161. displayed) differently.  Hex numbers in C are written like `0x1ae',
  162. while in Modula-2 they appear as `1AEH'.
  163.  
  164.    Language-specific information is built into GDB for some languages,
  165. allowing you to express operations like the above in your program's
  166. native language, and allowing GDB to output values in a manner
  167. consistent with the syntax of your program's native language.  The
  168. language you use to build expressions, called the "working language",
  169. can be selected manually, or GDB can set it automatically.
  170.  
  171. * Menu:
  172.  
  173. * Setting::                     Switching between source languages
  174. * Show::                        Displaying the language
  175. * Checks::                      Type and range checks
  176. * Support::                     Supported languages
  177.  
  178. 
  179. File: gdb.info,  Node: Setting,  Next: Show,  Up: Languages
  180.  
  181. Switching between source languages
  182. ==================================
  183.  
  184.    There are two ways to control the working language--either have GDB
  185. set it automatically, or select it manually yourself.  You can use the
  186. `set language' command for either purpose.  On startup, GDB defaults to
  187. setting the language automatically.
  188.  
  189. * Menu:
  190.  
  191. * Manually::                    Setting the working language manually
  192. * Automatically::               Having GDB infer the source language
  193.  
  194. 
  195. File: gdb.info,  Node: Manually,  Next: Automatically,  Up: Setting
  196.  
  197. Setting the working language
  198. ----------------------------
  199.  
  200.    If you allow GDB to set the language automatically, expressions are
  201. interpreted the same way in your debugging session and your program.
  202.  
  203.    If you wish, you may set the language manually.  To do this, issue
  204. the command `set language LANG', where LANG is the name of a language,
  205. such as `c' or `modula-2'.  For a list of the supported languages, type
  206. `set language'.
  207.  
  208.    Setting the language manually prevents GDB from updating the working
  209. language automatically.  This can lead to confusion if you try to debug
  210. a program when the working language is not the same as the source
  211. language, when an expression is acceptable to both languages--but means
  212. different things.  For instance, if the current source file were
  213. written in C, and GDB was parsing Modula-2, a command such as:
  214.  
  215.      print a = b + c
  216.  
  217. might not have the effect you intended.  In C, this means to add `b'
  218. and `c' and place the result in `a'.  The result printed would be the
  219. value of `a'.  In Modula-2, this means to compare `a' to the result of
  220. `b+c', yielding a `BOOLEAN' value.
  221.  
  222. 
  223. File: gdb.info,  Node: Automatically,  Prev: Manually,  Up: Setting
  224.  
  225. Having GDB infer the source language
  226. ------------------------------------
  227.  
  228.    To have GDB set the working language automatically, use `set
  229. language local' or `set language auto'.  GDB then infers the language
  230. that a program was written in by looking at the name of its source
  231. files, and examining their extensions:
  232.  
  233. `*.mod'
  234.      Modula-2 source file
  235.  
  236. `*.c'
  237.      C source file
  238.  
  239. `*.C'
  240. `*.cc'
  241.      C++ source file
  242.  
  243.    This information is recorded for each function or procedure in a
  244. source file.  When your program stops in a frame (usually by
  245. encountering a breakpoint), GDB sets the working language to the
  246. language recorded for the function in that frame.  If the language for
  247. a frame is unknown (that is, if the function or block corresponding to
  248. the frame was defined in a source file that does not have a recognized
  249. extension), the current working language is not changed, and GDB issues
  250. a warning.
  251.  
  252.    This may not seem necessary for most programs, which are written
  253. entirely in one source language.  However, program modules and libraries
  254. written in one source language can be used by a main program written in
  255. a different source language.  Using `set language auto' in this case
  256. frees you from having to set the working language manually.
  257.  
  258. 
  259. File: gdb.info,  Node: Show,  Next: Checks,  Prev: Setting,  Up: Languages
  260.  
  261. Displaying the language
  262. =======================
  263.  
  264.    The following commands will help you find out which language is the
  265. working language, and also what language source files were written in.
  266.  
  267. `show language'
  268.      Display the current working language.  This is the language you
  269.      can use with commands such as `print' to build and compute
  270.      expressions that may involve variables in your program.
  271.  
  272. `info frame'
  273.      Among the other information listed here (*note Information about a
  274.      frame: Frame Info.) is the source language for this frame.  This
  275.      is the language that will become the working language if you ever
  276.      use an identifier that is in this frame.
  277.  
  278. `info source'
  279.      Among the other information listed here (*note Examining the
  280.      Symbol Table: Symbols.) is the source language of this source file.
  281.  
  282. 
  283. File: gdb.info,  Node: Checks,  Next: Support,  Prev: Show,  Up: Languages
  284.  
  285. Type and range checking
  286. =======================
  287.  
  288.      *Warning:* In this release, the GDB commands for type and range
  289.      checking are included, but they do not yet have any effect.  This
  290.      section documents the intended facilities.
  291.  
  292.    Some languages are designed to guard you against making seemingly
  293. common errors through a series of compile- and run-time checks.  These
  294. include checking the type of arguments to functions and operators, and
  295. making sure mathematical overflows are caught at run time.  Checks such
  296. as these help to ensure a program's correctness once it has been
  297. compiled by eliminating type mismatches, and providing active checks
  298. for range errors when your program is running.
  299.  
  300.    GDB can check for conditions like the above if you wish.  Although
  301. GDB will not check the statements in your program, it can check
  302. expressions entered directly into GDB for evaluation via the `print'
  303. command, for example.  As with the working language, GDB can also
  304. decide whether or not to check automatically based on your program's
  305. source language.  *Note Supported languages: Support, for the default
  306. settings of supported languages.
  307.  
  308. * Menu:
  309.  
  310. * Type Checking::               An overview of type checking
  311. * Range Checking::              An overview of range checking
  312.  
  313. 
  314. File: gdb.info,  Node: Type Checking,  Next: Range Checking,  Up: Checks
  315.  
  316. An overview of type checking
  317. ----------------------------
  318.  
  319.    Some languages, such as Modula-2, are strongly typed, meaning that
  320. the arguments to operators and functions have to be of the correct type,
  321. otherwise an error occurs.  These checks prevent type mismatch errors
  322. from ever causing any run-time problems.  For example,
  323.  
  324.      1 + 2 => 3
  325. but
  326.      error--> 1 + 2.3
  327.  
  328.    The second example fails because the `CARDINAL' 1 is not
  329. type-compatible with the `REAL' 2.3.
  330.  
  331.    For expressions you use in GDB commands, you can tell the GDB type
  332. checker to skip checking; to treat any mismatches as errors and abandon
  333. the expression; or only issue warnings when type mismatches occur, but
  334. evaluate the expression anyway.  When you choose the last of these, GDB
  335. evaluates expressions like the second example above, but also issues a
  336. warning.
  337.  
  338.    Even though you may turn type checking off, other type-based reasons
  339. may prevent GDB from evaluating an expression.  For instance, GDB does
  340. not know how to add an `int' and a `struct foo'.  These particular type
  341. errors have nothing to do with the language in use, and usually arise
  342. from expressions, such as the one described above, which make little
  343. sense to evaluate anyway.
  344.  
  345.    Each language defines to what degree it is strict about type.  For
  346. instance, both Modula-2 and C require the arguments to arithmetical
  347. operators to be numbers.  In C, enumerated types and pointers can be
  348. represented as numbers, so that they are valid arguments to mathematical
  349. operators.  *Note Supported languages: Support, for further details on
  350. specific languages.
  351.  
  352.    GDB provides some additional commands for controlling the type
  353. checker:
  354.  
  355. `set check type auto'
  356.      Set type checking on or off based on the current working language.
  357.      *Note Supported languages: Support, for the default settings for
  358.      each language.
  359.  
  360. `set check type on'
  361. `set check type off'
  362.      Set type checking on or off, overriding the default setting for the
  363.      current working language.  Issue a warning if the setting does not
  364.      match the language default.  If any type mismatches occur in
  365.      evaluating an expression while typechecking is on, GDB prints a
  366.      message and aborts evaluation of the expression.
  367.  
  368. `set check type warn'
  369.      Cause the type checker to issue warnings, but to always attempt to
  370.      evaluate the expression.  Evaluating the expression may still be
  371.      impossible for other reasons.  For example, GDB cannot add numbers
  372.      and structures.
  373.  
  374. `show type'
  375.      Show the current setting of the type checker, and whether or not
  376.      GDB is setting it automatically.
  377.  
  378. 
  379. File: gdb.info,  Node: Range Checking,  Prev: Type Checking,  Up: Checks
  380.  
  381. An overview of range checking
  382. -----------------------------
  383.  
  384.    In some languages (such as Modula-2), it is an error to exceed the
  385. bounds of a type; this is enforced with run-time checks.  Such range
  386. checking is meant to ensure program correctness by making sure
  387. computations do not overflow, or indices on an array element access do
  388. not exceed the bounds of the array.
  389.  
  390.    For expressions you use in GDB commands, you can tell GDB to treat
  391. range errors in one of three ways: ignore them, always treat them as
  392. errors and abandon the expression, or issue warnings but evaluate the
  393. expression anyway.
  394.  
  395.    A range error can result from numerical overflow, from exceeding an
  396. array index bound, or when you type a constant that is not a member of
  397. any type.  Some languages, however, do not treat overflows as an error.
  398. In many implementations of C, mathematical overflow causes the result
  399. to "wrap around" to lower values--for example, if M is the largest
  400. integer value, and S is the smallest, then
  401.  
  402.      M + 1 => S
  403.  
  404.    This, too, is specific to individual languages, and in some cases
  405. specific to individual compilers or machines.  *Note Supported
  406. languages: Support, for further details on specific languages.
  407.  
  408.    GDB provides some additional commands for controlling the range
  409. checker:
  410.  
  411. `set check range auto'
  412.      Set range checking on or off based on the current working language.
  413.      *Note Supported languages: Support, for the default settings for
  414.      each language.
  415.  
  416. `set check range on'
  417. `set check range off'
  418.      Set range checking on or off, overriding the default setting for
  419.      the current working language.  A warning is issued if the setting
  420.      does not match the language default.  If a range error occurs,
  421.      then a message is printed and evaluation of the expression is
  422.      aborted.
  423.  
  424. `set check range warn'
  425.      Output messages when the GDB range checker detects a range error,
  426.      but attempt to evaluate the expression anyway.  Evaluating the
  427.      expression may still be impossible for other reasons, such as
  428.      accessing memory that the process does not own (a typical example
  429.      from many UNIX systems).
  430.  
  431. `show range'
  432.      Show the current setting of the range checker, and whether or not
  433.      it is being set automatically by GDB.
  434.  
  435. 
  436. File: gdb.info,  Node: Support,  Prev: Checks,  Up: Languages
  437.  
  438. Supported languages
  439. ===================
  440.  
  441.    GDB 4 supports C, C++, and Modula-2.  Some GDB features may be used
  442. in expressions regardless of the language you use: the GDB `@' and `::'
  443. operators, and the `{type}addr' construct (*note Expressions:
  444. Expressions.) can be used with the constructs of any of the supported
  445. languages.
  446.  
  447.    The following sections detail to what degree each of these source
  448. languages is supported by GDB.  These sections are not meant to be
  449. language tutorials or references, but serve only as a reference guide
  450. to what the GDB expression parser will accept, and what input and
  451. output formats should look like for different languages.  There are
  452. many good books written on each of these languages; please look to
  453. these for a language reference or tutorial.
  454.  
  455. * Menu:
  456.  
  457. * C::                           C and C++
  458. * Modula-2::                    Modula-2
  459.  
  460. 
  461. File: gdb.info,  Node: C,  Next: Modula-2,  Up: Support
  462.  
  463. C and C++
  464. ---------
  465.  
  466.    Since C and C++ are so closely related, many features of GDB apply
  467. to both languages.  Whenever this is the case, we discuss both languages
  468. together.
  469.  
  470.    The C++ debugging facilities are jointly implemented by the GNU C++
  471. compiler and GDB.  Therefore, to debug your C++ code effectively, you
  472. must compile your C++ programs with the GNU C++ compiler, `g++'.
  473.  
  474. * Menu:
  475.  
  476. * C Operators::                 C and C++ operators
  477. * C Constants::                 C and C++ constants
  478. * Cplus expressions::           C++ expressions
  479. * C Defaults::                  Default settings for C and C++
  480. * C Checks::                    C and C++ type and range checks
  481. * Debugging C::                 GDB and C
  482. * Debugging C plus plus::       Special features for C++
  483.  
  484. 
  485. File: gdb.info,  Node: C Operators,  Next: C Constants,  Up: C
  486.  
  487. C and C++ operators
  488. -------------------
  489.  
  490.    Operators must be defined on values of specific types.  For instance,
  491. `+' is defined on numbers, but not on structures.  Operators are often
  492. defined on groups of types.
  493.  
  494.    For the purposes of C and C++, the following definitions hold:
  495.  
  496.    * *Integral types* include `int' with any of its storage-class
  497.      specifiers; `char'; and `enum'.
  498.  
  499.    * *Floating-point types* include `float' and `double'.
  500.  
  501.    * *Pointer types* include all types defined as `(TYPE *)'.
  502.  
  503.    * *Scalar types* include all of the above.
  504.  
  505. The following operators are supported.  They are listed here in order
  506. of increasing precedence:
  507.  
  508. `,'
  509.      The comma or sequencing operator.  Expressions in a
  510.      comma-separated list are evaluated from left to right, with the
  511.      result of the entire expression being the last expression
  512.      evaluated.
  513.  
  514. `='
  515.      Assignment.  The value of an assignment expression is the value
  516.      assigned.  Defined on scalar types.
  517.  
  518. `OP='
  519.      Used in an expression of the form `A OP= B', and translated to
  520.      `A = A OP B'.  `OP=' and `=' have the same precendence.  OP is any
  521.      one of the operators `|', `^', `&', `<<', `>>', `+', `-', `*',
  522.      `/', `%'.
  523.  
  524. `?:'
  525.      The ternary operator.  `A ? B : C' can be thought of as:  if A
  526.      then B else C.  A should be of an integral type.
  527.  
  528. `||'
  529.      Logical OR.  Defined on integral types.
  530.  
  531. `&&'
  532.      Logical AND.  Defined on integral types.
  533.  
  534. `|'
  535.      Bitwise OR.  Defined on integral types.
  536.  
  537. `^'
  538.      Bitwise exclusive-OR.  Defined on integral types.
  539.  
  540. `&'
  541.      Bitwise AND.  Defined on integral types.
  542.  
  543. `==, !='
  544.      Equality and inequality.  Defined on scalar types.  The value of
  545.      these expressions is 0 for false and non-zero for true.
  546.  
  547. `<, >, <=, >='
  548.      Less than, greater than, less than or equal, greater than or equal.
  549.      Defined on scalar types.  The value of these expressions is 0 for
  550.      false and non-zero for true.
  551.  
  552. `<<, >>'
  553.      left shift, and right shift.  Defined on integral types.
  554.  
  555. `@'
  556.      The GDB "artificial array" operator (*note Expressions:
  557.      Expressions.).
  558.  
  559. `+, -'
  560.      Addition and subtraction.  Defined on integral types,
  561.      floating-point types and pointer types.
  562.  
  563. `*, /, %'
  564.      Multiplication, division, and modulus.  Multiplication and
  565.      division are defined on integral and floating-point types.
  566.      Modulus is defined on integral types.
  567.  
  568. `++, --'
  569.      Increment and decrement.  When appearing before a variable, the
  570.      operation is performed before the variable is used in an
  571.      expression; when appearing after it, the variable's value is used
  572.      before the operation takes place.
  573.  
  574. `*'
  575.      Pointer dereferencing.  Defined on pointer types.  Same precedence
  576.      as `++'.
  577.  
  578. `&'
  579.      Address operator.  Defined on variables.  Same precedence as `++'.
  580.  
  581.      For debugging C++, GDB implements a use of `&' beyond what is
  582.      allowed in the C++ language itself: you can use `&(&REF)' (or, if
  583.      you prefer, simply `&&REF' to examine the address where a C++
  584.      reference variable (declared with `&REF') is stored.
  585.  
  586. `-'
  587.      Negative.  Defined on integral and floating-point types.  Same
  588.      precedence as `++'.
  589.  
  590. `!'
  591.      Logical negation.  Defined on integral types.  Same precedence as
  592.      `++'.
  593.  
  594. `~'
  595.      Bitwise complement operator.  Defined on integral types.  Same
  596.      precedence as `++'.
  597.  
  598. `., ->'
  599.      Structure member, and pointer-to-structure member.  For
  600.      convenience, GDB regards the two as equivalent, choosing whether
  601.      to dereference a pointer based on the stored type information.
  602.      Defined on `struct' and `union' data.
  603.  
  604. `[]'
  605.      Array indexing.  `A[I]' is defined as `*(A+I)'.  Same precedence
  606.      as `->'.
  607.  
  608. `()'
  609.      Function parameter list.  Same precedence as `->'.
  610.  
  611. `::'
  612.      C++ scope resolution operator.  Defined on `struct', `union', and
  613.      `class' types.
  614.  
  615. `::'
  616.      Doubled colons also represent the GDB scope operator (*note
  617.      Expressions: Expressions.).  Same precedence as `::', above.
  618.  
  619. 
  620. File: gdb.info,  Node: C Constants,  Next: Cplus expressions,  Prev: C Operators,  Up: C
  621.  
  622. C and C++ constants
  623. -------------------
  624.  
  625.    GDB allows you to express the constants of C and C++ in the
  626. following ways:
  627.  
  628.    * Integer constants are a sequence of digits.  Octal constants are
  629.      specified by a leading `0' (ie. zero), and hexadecimal constants by
  630.      a leading `0x' or `0X'.  Constants may also end with a letter `l',
  631.      specifying that the constant should be treated as a `long' value.
  632.  
  633.    * Floating point constants are a sequence of digits, followed by a
  634.      decimal point, followed by a sequence of digits, and optionally
  635.      followed by an exponent.  An exponent is of the form:
  636.      `e[[+]|-]NNN', where NNN is another sequence of digits.  The `+'
  637.      is optional for positive exponents.
  638.  
  639.    * Enumerated constants consist of enumerated identifiers, or their
  640.      integral equivalents.
  641.  
  642.    * Character constants are a single character surrounded by single
  643.      quotes (`''), or a number--the ordinal value of the corresponding
  644.      character (usually its ASCII value).  Within quotes, the single
  645.      character may be represented by a letter or by "escape sequences",
  646.      which are of the form `\NNN', where NNN is the octal representation
  647.      of the character's ordinal value; or of the form `\X', where `X'
  648.      is a predefined special character--for example, `\n' for newline.
  649.  
  650.    * String constants are a sequence of character constants surrounded
  651.      by double quotes (`"').
  652.  
  653.    * Pointer constants are an integral value.  You can also write
  654.      pointers to constants using the C operator `&'.
  655.  
  656.    * Array constants are comma-separated lists surrounded by braces `{'
  657.      and `}'; for example, `{1,2,3}' is a three-element array of
  658.      integers, `{{1,2}, {3,4}, {5,6}}' is a three-by-two array, and
  659.      `{&"hi", &"there", &"fred"}' is a three-element array of pointers.
  660.  
  661. 
  662. File: gdb.info,  Node: Cplus expressions,  Next: C Defaults,  Prev: C Constants,  Up: C
  663.  
  664. C++ expressions
  665. ---------------
  666.  
  667.    GDB expression handling has a number of extensions to interpret a
  668. significant subset of C++ expressions.
  669.  
  670.      *Warning:* Most of these extensions depend on the use of additional
  671.      debugging information in the symbol table, and thus require a rich,
  672.      extendable object code format.  In particular, if your system uses
  673.      a.out, MIPS ECOFF, RS/6000 XCOFF, or Sun ELF with stabs extensions
  674.      to the symbol table, these facilities are all available.  Where
  675.      the object code format is standard COFF, on the other hand, most
  676.      of the C++ support in GDB will *not* work, nor can it.  For the
  677.      standard SVr4 debugging format, DWARF in ELF, the standard is
  678.      still evolving, so the C++ support in GDB is still fragile; when
  679.      this debugging format stabilizes, however, C++ support will also
  680.      be available on systems that use it.
  681.  
  682.   1. Member function calls are allowed; you can use expressions like
  683.  
  684.           count = aml->GetOriginal(x, y)
  685.  
  686.   2. While a member function is active (in the selected stack frame),
  687.      your expressions have the same namespace available as the member
  688.      function; that is, GDB allows implicit references to the class
  689.      instance pointer `this' following the same rules as C++.
  690.  
  691.   3. You can call overloaded functions; GDB will resolve the function
  692.      call to the right definition, with one restriction--you must use
  693.      arguments of the type required by the function that you want to
  694.      call.  GDB will not perform conversions requiring constructors or
  695.      user-defined type operators.
  696.  
  697.   4. GDB understands variables declared as C++ references; you can use
  698.      them in expressions just as you do in C++ source--they are
  699.      automatically dereferenced.
  700.  
  701.      In the parameter list shown when GDB displays a frame, the values
  702.      of reference variables are not displayed (unlike other variables);
  703.      this avoids clutter, since references are often used for large
  704.      structures.  The *address* of a reference variable is always
  705.      shown, unless you have specified `set print address off'.
  706.  
  707.   5. GDB supports the C++ name resolution operator `::'--your
  708.      expressions can use it just as expressions in your program do.
  709.      Since one scope may be defined in another, you can use `::'
  710.      repeatedly if necessary, for example in an expression like
  711.      `SCOPE1::SCOPE2::NAME'.  GDB also allows resolving name scope by
  712.      reference to source files, in both C and C++ debugging (*note
  713.      Program variables: Variables.).
  714.  
  715. 
  716. File: gdb.info,  Node: C Defaults,  Next: C Checks,  Prev: Cplus expressions,  Up: C
  717.  
  718. C and C++ defaults
  719. ------------------
  720.  
  721.    If you allow GDB to set type and range checking automatically, they
  722. both default to `off' whenever the working language changes to C or
  723. C++.  This happens regardless of whether you, or GDB, selected the
  724. working language.
  725.  
  726.    If you allow GDB to set the language automatically, it sets the
  727. working language to C or C++ on entering code compiled from a source
  728. file whose name ends with `.c', `.C', or `.cc'.  *Note Having GDB infer
  729. the source language: Automatically, for further details.
  730.  
  731. 
  732. File: gdb.info,  Node: C Checks,  Next: Debugging C,  Prev: C Defaults,  Up: C
  733.  
  734. C and C++ type and range checks
  735. -------------------------------
  736.  
  737.    By default, when GDB parses C or C++ expressions, type checking is
  738. not used.  However, if you turn type checking on, GDB will consider two
  739. variables type equivalent if:
  740.  
  741.    * The two variables are structured and have the same structure,
  742.      union, or enumerated tag.
  743.  
  744.    * Two two variables have the same type name, or types that have been
  745.      declared equivalent through `typedef'.
  746.  
  747.    Range checking, if turned on, is done on mathematical operations.
  748. Array indices are not checked, since they are often used to index a
  749. pointer that is not itself an array.
  750.  
  751. 
  752. File: gdb.info,  Node: Debugging C,  Next: Debugging C plus plus,  Prev: C Checks,  Up: C
  753.  
  754. GDB and C
  755. ---------
  756.  
  757.    The `set print union' and `show print union' commands apply to the
  758. `union' type.  When set to `on', any `union' that is inside a `struct'
  759. or `class' will also be printed.  Otherwise, it will appear as `{...}'.
  760.  
  761.    The `@' operator aids in the debugging of dynamic arrays, formed
  762. with pointers and a memory allocation function.  *Note Expressions:
  763. Expressions.
  764.  
  765. 
  766. File: gdb.info,  Node: Debugging C plus plus,  Prev: Debugging C,  Up: C
  767.  
  768. GDB features for C++
  769. --------------------
  770.  
  771.    Some GDB commands are particularly useful with C++, and some are
  772. designed specifically for use with C++.  Here is a summary:
  773.  
  774. `breakpoint menus'
  775.      When you want a breakpoint in a function whose name is overloaded,
  776.      GDB breakpoint menus help you specify which function definition
  777.      you want.  *Note Breakpoint menus: Breakpoint Menus.
  778.  
  779. `rbreak REGEX'
  780.      Setting breakpoints using regular expressions is helpful for
  781.      setting breakpoints on overloaded functions that are not members
  782.      of any special classes.  *Note Setting breakpoints: Set Breaks.
  783.  
  784. `catch EXCEPTIONS'
  785. `info catch'
  786.      Debug C++ exception handling using these commands.  *Note
  787.      Breakpoints and exceptions: Exception Handling.
  788.  
  789. `ptype TYPENAME'
  790.      Print inheritance relationships as well as other information for
  791.      type TYPENAME.  *Note Examining the Symbol Table: Symbols.
  792.  
  793. `set print demangle'
  794. `show print demangle'
  795. `set print asm-demangle'
  796. `show print asm-demangle'
  797.      Control whether C++ symbols display in their source form, both when
  798.      displaying code as C++ source and when displaying disassemblies.
  799.      *Note Print settings: Print Settings.
  800.  
  801. `set print object'
  802. `show print object'
  803.      Choose whether to print derived (actual) or declared types of
  804.      objects.  *Note Print settings: Print Settings.
  805.  
  806. `set print vtbl'
  807. `show print vtbl'
  808.      Control the format for printing virtual function tables.  *Note
  809.      Print settings: Print Settings.
  810.  
  811. `Overloaded symbol names'
  812.      You can specify a particular definition of an overloaded symbol,
  813.      using the same notation that is used to declare such symbols in
  814.      C++: type `SYMBOL(TYPES)' rather than just SYMBOL.  You can also
  815.      use the GDB command-line word completion facilities to list the
  816.      available choices, or to finish the type list for you.  *Note
  817.      Command completion: Completion, for details on how to do this.
  818.  
  819. 
  820. File: gdb.info,  Node: Modula-2,  Prev: C,  Up: Support
  821.  
  822. Modula-2
  823. --------
  824.  
  825.    The extensions made to GDB to support Modula-2 only support output
  826. from the GNU Modula-2 compiler (which is currently being developed).
  827. Other Modula-2 compilers are not currently supported, and attempting to
  828. debug executables produced by them will most likely result in an error
  829. as GDB reads in the executable's symbol table.
  830.  
  831. * Menu:
  832.  
  833. * M2 Operators::                Built-in operators
  834. * Built-In Func/Proc::           Built-in functions and procedures
  835. * M2 Constants::                Modula-2 constants
  836. * M2 Defaults::                 Default settings for Modula-2
  837. * Deviations::                  Deviations from standard Modula-2
  838. * M2 Checks::                   Modula-2 type and range checks
  839. * M2 Scope::                    The scope operators `::' and `.'
  840. * GDB/M2::                      GDB and Modula-2
  841.  
  842. 
  843. File: gdb.info,  Node: M2 Operators,  Next: Built-In Func/Proc,  Up: Modula-2
  844.  
  845. Operators
  846. ---------
  847.  
  848.    Operators must be defined on values of specific types.  For instance,
  849. `+' is defined on numbers, but not on structures.  Operators are often
  850. defined on groups of types.  For the purposes of Modula-2, the
  851. following definitions hold:
  852.  
  853.    * *Integral types* consist of `INTEGER', `CARDINAL', and their
  854.      subranges.
  855.  
  856.    * *Character types* consist of `CHAR' and its subranges.
  857.  
  858.    * *Floating-point types* consist of `REAL'.
  859.  
  860.    * *Pointer types* consist of anything declared as `POINTER TO TYPE'.
  861.  
  862.    * *Scalar types* consist of all of the above.
  863.  
  864.    * *Set types* consist of `SET' and `BITSET' types.
  865.  
  866.    * *Boolean types* consist of `BOOLEAN'.
  867.  
  868. The following operators are supported, and appear in order of
  869. increasing precedence:
  870.  
  871. `,'
  872.      Function argument or array index separator.
  873.  
  874. `:='
  875.      Assignment.  The value of VAR `:=' VALUE is VALUE.
  876.  
  877. `<, >'
  878.      Less than, greater than on integral, floating-point, or enumerated
  879.      types.
  880.  
  881. `<=, >='
  882.      Less than, greater than, less than or equal to, greater than or
  883.      equal to on integral, floating-point and enumerated types, or set
  884.      inclusion on set types.  Same precedence as `<'.
  885.  
  886. `=, <>, #'
  887.      Equality and two ways of expressing inequality, valid on scalar
  888.      types.  Same precedence as `<'.  In GDB scripts, only `<>' is
  889.      available for inequality, since `#' conflicts with the script
  890.      comment character.
  891.  
  892. `IN'
  893.      Set membership.  Defined on set types and the types of their
  894.      members.  Same precedence as `<'.
  895.  
  896. `OR'
  897.      Boolean disjunction.  Defined on boolean types.
  898.  
  899. `AND, &'
  900.      Boolean conjuction.  Defined on boolean types.
  901.  
  902. `@'
  903.      The GDB "artificial array" operator (*note Expressions:
  904.      Expressions.).
  905.  
  906. `+, -'
  907.      Addition and subtraction on integral and floating-point types, or
  908.      union and difference on set types.
  909.  
  910. `*'
  911.      Multiplication on integral and floating-point types, or set
  912.      intersection on set types.
  913.  
  914. `/'
  915.      Division on floating-point types, or symmetric set difference on
  916.      set types.  Same precedence as `*'.
  917.  
  918. `DIV, MOD'
  919.      Integer division and remainder.  Defined on integral types.  Same
  920.      precedence as `*'.
  921.  
  922. `-'
  923.      Negative. Defined on `INTEGER' and `REAL' data.
  924.  
  925. `^'
  926.      Pointer dereferencing.  Defined on pointer types.
  927.  
  928. `NOT'
  929.      Boolean negation.  Defined on boolean types.  Same precedence as
  930.      `^'.
  931.  
  932. `.'
  933.      `RECORD' field selector.  Defined on `RECORD' data.  Same
  934.      precedence as `^'.
  935.  
  936. `[]'
  937.      Array indexing.  Defined on `ARRAY' data.  Same precedence as `^'.
  938.  
  939. `()'
  940.      Procedure argument list.  Defined on `PROCEDURE' objects.  Same
  941.      precedence as `^'.
  942.  
  943. `::, .'
  944.      GDB and Modula-2 scope operators.
  945.  
  946.      *Warning:* Sets and their operations are not yet supported, so GDB
  947.      will treat the use of the operator `IN', or the use of operators
  948.      `+', `-', `*', `/', `=', , `<>', `#', `<=', and `>=' on sets as an
  949.      error.
  950.  
  951. 
  952. File: gdb.info,  Node: Built-In Func/Proc,  Next: M2 Constants,  Prev: M2 Operators,  Up: Modula-2
  953.  
  954. Built-in functions and procedures
  955. ---------------------------------
  956.  
  957.    Modula-2 also makes available several built-in procedures and
  958. functions.  In describing these, the following metavariables are used:
  959.  
  960. A
  961.      represents an `ARRAY' variable.
  962.  
  963. C
  964.      represents a `CHAR' constant or variable.
  965.  
  966. I
  967.      represents a variable or constant of integral type.
  968.  
  969. M
  970.      represents an identifier that belongs to a set.  Generally used in
  971.      the same function with the metavariable S.  The type of S should
  972.      be `SET OF MTYPE' (where MTYPE is the type of M.
  973.  
  974. N
  975.      represents a variable or constant of integral or floating-point
  976.      type.
  977.  
  978. R
  979.      represents a variable or constant of floating-point type.
  980.  
  981. T
  982.      represents a type.
  983.  
  984. V
  985.      represents a variable.
  986.  
  987. X
  988.      represents a variable or constant of one of many types.  See the
  989.      explanation of the function for details.
  990.  
  991.    All Modula-2 built-in procedures also return a result, described
  992. below.
  993.  
  994. `ABS(N)'
  995.      Returns the absolute value of N.
  996.  
  997. `CAP(C)'
  998.      If C is a lower case letter, it returns its upper case equivalent,
  999.      otherwise it returns its argument
  1000.  
  1001. `CHR(I)'
  1002.      Returns the character whose ordinal value is I.
  1003.  
  1004. `DEC(V)'
  1005.      Decrements the value in the variable V.  Returns the new value.
  1006.  
  1007. `DEC(V,I)'
  1008.      Decrements the value in the variable V by I.  Returns the new
  1009.      value.
  1010.  
  1011. `EXCL(M,S)'
  1012.      Removes the element M from the set S.  Returns the new set.
  1013.  
  1014. `FLOAT(I)'
  1015.      Returns the floating point equivalent of the integer I.
  1016.  
  1017. `HIGH(A)'
  1018.      Returns the index of the last member of A.
  1019.  
  1020. `INC(V)'
  1021.      Increments the value in the variable V.  Returns the new value.
  1022.  
  1023. `INC(V,I)'
  1024.      Increments the value in the variable V by I.  Returns the new
  1025.      value.
  1026.  
  1027. `INCL(M,S)'
  1028.      Adds the element M to the set S if it is not already there.
  1029.      Returns the new set.
  1030.  
  1031. `MAX(T)'
  1032.      Returns the maximum value of the type T.
  1033.  
  1034. `MIN(T)'
  1035.      Returns the minimum value of the type T.
  1036.  
  1037. `ODD(I)'
  1038.      Returns boolean TRUE if I is an odd number.
  1039.  
  1040. `ORD(X)'
  1041.      Returns the ordinal value of its argument.  For example, the
  1042.      ordinal value of a character is its ASCII value (on machines
  1043.      supporting the ASCII character set).  X must be of an ordered
  1044.      type, which include integral, character and enumerated types.
  1045.  
  1046. `SIZE(X)'
  1047.      Returns the size of its argument.  X can be a variable or a type.
  1048.  
  1049. `TRUNC(R)'
  1050.      Returns the integral part of R.
  1051.  
  1052. `VAL(T,I)'
  1053.      Returns the member of the type T whose ordinal value is I.
  1054.  
  1055.      *Warning:*  Sets and their operations are not yet supported, so
  1056.      GDB will treat the use of procedures `INCL' and `EXCL' as an error.
  1057.  
  1058. 
  1059. File: gdb.info,  Node: M2 Constants,  Next: M2 Defaults,  Prev: Built-In Func/Proc,  Up: Modula-2
  1060.  
  1061. Constants
  1062. ---------
  1063.  
  1064.    GDB allows you to express the constants of Modula-2 in the following
  1065. ways:
  1066.  
  1067.    * Integer constants are simply a sequence of digits.  When used in an
  1068.      expression, a constant is interpreted to be type-compatible with
  1069.      the rest of the expression.  Hexadecimal integers are specified by
  1070.      a trailing `H', and octal integers by a trailing `B'.
  1071.  
  1072.    * Floating point constants appear as a sequence of digits, followed
  1073.      by a decimal point and another sequence of digits.  An optional
  1074.      exponent can then be specified, in the form `E[+|-]NNN', where
  1075.      `[+|-]NNN' is the desired exponent.  All of the digits of the
  1076.      floating point constant must be valid decimal (base 10) digits.
  1077.  
  1078.    * Character constants consist of a single character enclosed by a
  1079.      pair of like quotes, either single (`'') or double (`"').  They may
  1080.      also be expressed by their ordinal value (their ASCII value,
  1081.      usually) followed by a `C'.
  1082.  
  1083.    * String constants consist of a sequence of characters enclosed by a
  1084.      pair of like quotes, either single (`'') or double (`"').  Escape
  1085.      sequences in the style of C are also allowed.  *Note C and C++
  1086.      constants: C Constants, for a brief explanation of escape
  1087.      sequences.
  1088.  
  1089.    * Enumerated constants consist of an enumerated identifier.
  1090.  
  1091.    * Boolean constants consist of the identifiers `TRUE' and `FALSE'.
  1092.  
  1093.    * Pointer constants consist of integral values only.
  1094.  
  1095.    * Set constants are not yet supported.
  1096.  
  1097. 
  1098. File: gdb.info,  Node: M2 Defaults,  Next: Deviations,  Prev: M2 Constants,  Up: Modula-2
  1099.  
  1100. Modula-2 defaults
  1101. -----------------
  1102.  
  1103.    If type and range checking are set automatically by GDB, they both
  1104. default to `on' whenever the working language changes to Modula-2.
  1105. This happens regardless of whether you, or GDB, selected the working
  1106. language.
  1107.  
  1108.    If you allow GDB to set the language automatically, then entering
  1109. code compiled from a file whose name ends with `.mod' will set the
  1110. working language to Modula-2. *Note Having GDB set the language
  1111. automatically: Automatically, for further details.
  1112.  
  1113. 
  1114. File: gdb.info,  Node: Deviations,  Next: M2 Checks,  Prev: M2 Defaults,  Up: Modula-2
  1115.  
  1116. Deviations from standard Modula-2
  1117. ---------------------------------
  1118.  
  1119.    A few changes have been made to make Modula-2 programs easier to
  1120. debug.  This is done primarily via loosening its type strictness:
  1121.  
  1122.    * Unlike in standard Modula-2, pointer constants can be formed by
  1123.      integers.  This allows you to modify pointer variables during
  1124.      debugging.  (In standard Modula-2, the actual address contained in
  1125.      a pointer variable is hidden from you; it can only be modified
  1126.      through direct assignment to another pointer variable or
  1127.      expression that returned a pointer.)
  1128.  
  1129.    * C escape sequences can be used in strings and characters to
  1130.      represent non-printable characters.  GDB will print out strings
  1131.      with these escape sequences embedded.  Single non-printable
  1132.      characters are printed using the `CHR(NNN)' format.
  1133.  
  1134.    * The assignment operator (`:=') returns the value of its right-hand
  1135.      argument.
  1136.  
  1137.    * All built-in procedures both modify *and* return their argument.
  1138.  
  1139. 
  1140. File: gdb.info,  Node: M2 Checks,  Next: M2 Scope,  Prev: Deviations,  Up: Modula-2
  1141.  
  1142. Modula-2 type and range checks
  1143. ------------------------------
  1144.  
  1145.      *Warning:* in this release, GDB does not yet perform type or range
  1146.      checking.
  1147.  
  1148.    GDB considers two Modula-2 variables type equivalent if:
  1149.  
  1150.    * They are of types that have been declared equivalent via a `TYPE
  1151.      T1 = T2' statement
  1152.  
  1153.    * They have been declared on the same line.  (Note:  This is true of
  1154.      the GNU Modula-2 compiler, but it may not be true of other
  1155.      compilers.)
  1156.  
  1157.    As long as type checking is enabled, any attempt to combine variables
  1158. whose types are not equivalent is an error.
  1159.  
  1160.    Range checking is done on all mathematical operations, assignment,
  1161. array index bounds, and all built-in functions and procedures.
  1162.  
  1163. 
  1164. File: gdb.info,  Node: M2 Scope,  Next: GDB/M2,  Prev: M2 Checks,  Up: Modula-2
  1165.  
  1166. The scope operators `::' and `.'
  1167. --------------------------------
  1168.  
  1169.    There are a few subtle differences between the Modula-2 scope
  1170. operator (`.') and the GDB scope operator (`::').  The two have similar
  1171. syntax:
  1172.  
  1173.  
  1174.      MODULE . ID
  1175.      SCOPE :: ID
  1176.  
  1177. where SCOPE is the name of a module or a procedure, MODULE the name of
  1178. a module, and ID is any declared identifier within your program, except
  1179. another module.
  1180.  
  1181.    Using the `::' operator makes GDB search the scope specified by
  1182. SCOPE for the identifier ID.  If it is not found in the specified
  1183. scope, then GDB will search all scopes enclosing the one specified by
  1184. SCOPE.
  1185.  
  1186.    Using the `.' operator makes GDB search the current scope for the
  1187. identifier specified by ID that was imported from the definition module
  1188. specified by MODULE.  With this operator, it is an error if the
  1189. identifier ID was not imported from definition module MODULE, or if ID
  1190. is not an identifier in MODULE.
  1191.  
  1192. 
  1193. File: gdb.info,  Node: GDB/M2,  Prev: M2 Scope,  Up: Modula-2
  1194.  
  1195. GDB and Modula-2
  1196. ----------------
  1197.  
  1198.    Some GDB commands have little use when debugging Modula-2 programs.
  1199. Five subcommands of `set print' and `show print' apply specifically to
  1200. C and C++: `vtbl', `demangle', `asm-demangle', `object', and `union'.
  1201. The first four apply to C++, and the last to the C `union' type, which
  1202. has no direct analogue in Modula-2.
  1203.  
  1204.    The `@' operator (*note Expressions: Expressions.), while available
  1205. while using any language, is not useful with Modula-2.  Its intent is
  1206. to aid the debugging of "dynamic arrays", which cannot be created in
  1207. Modula-2 as they can in C or C++.  However, because an address can be
  1208. specified by an integral constant, the construct `{TYPE}ADREXP' is
  1209. still useful.  (*note Expressions: Expressions.)
  1210.  
  1211.    In GDB scripts, the Modula-2 inequality operator `#' is interpreted
  1212. as the beginning of a comment.  Use `<>' instead.
  1213.  
  1214. 
  1215. File: gdb.info,  Node: Symbols,  Next: Altering,  Prev: Languages,  Up: Top
  1216.  
  1217. Examining the Symbol Table
  1218. **************************
  1219.  
  1220.    The commands described in this section allow you to inquire about the
  1221. symbols (names of variables, functions and types) defined in your
  1222. program.  This information is inherent in the text of your program and
  1223. does not change as your program executes.  GDB finds it in your
  1224. program's symbol table, in the file indicated when you started GDB
  1225. (*note Choosing files: File Options.), or by one of the file-management
  1226. commands (*note Commands to specify files: Files.).
  1227.  
  1228.    Occasionally, you may need to refer to symbols that contain unusual
  1229. characters, which GDB ordinarily treats as word delimiters.  The most
  1230. frequent case is in referring to static variables in other source files
  1231. (*note Program variables: Variables.).  File names are recorded in
  1232. object files as debugging symbols, but GDB would ordinarily parse a
  1233. typical file name, like `foo.c', as the three words `foo' `.' `c'.  To
  1234. allow GDB to recognize `foo.c' as a single symbol, enclose it in single
  1235. quotes; for example,
  1236.  
  1237.      p 'foo.c'::x
  1238.  
  1239. looks up the value of `x' in the scope of the file `foo.c'.
  1240.  
  1241. `info address SYMBOL'
  1242.      Describe where the data for SYMBOL is stored.  For a register
  1243.      variable, this says which register it is kept in.  For a
  1244.      non-register local variable, this prints the stack-frame offset at
  1245.      which the variable is always stored.
  1246.  
  1247.      Note the contrast with `print &SYMBOL', which does not work at all
  1248.      for a register variables, and for a stack local variable prints
  1249.      the exact address of the current instantiation of the variable.
  1250.  
  1251. `whatis EXP'
  1252.      Print the data type of expression EXP.  EXP is not actually
  1253.      evaluated, and any side-effecting operations (such as assignments
  1254.      or function calls) inside it do not take place.  *Note
  1255.      Expressions: Expressions.
  1256.  
  1257. `whatis'
  1258.      Print the data type of `$', the last value in the value history.
  1259.  
  1260. `ptype TYPENAME'
  1261.      Print a description of data type TYPENAME.  TYPENAME may be the
  1262.      name of a type, or for C code it may have the form `struct
  1263.      STRUCT-TAG', `union UNION-TAG' or `enum ENUM-TAG'.
  1264.  
  1265. `ptype EXP'
  1266. `ptype'
  1267.      Print a description of the type of expression EXP.  `ptype'
  1268.      differs from `whatis' by printing a detailed description, instead
  1269.      of just the name of the type.
  1270.  
  1271.      For example, for this variable declaration:
  1272.  
  1273.           struct complex {double real; double imag;} v;
  1274.  
  1275.      the two commands give this output:
  1276.  
  1277.           (gdb) whatis v
  1278.           type = struct complex
  1279.           (gdb) ptype v
  1280.           type = struct complex {
  1281.               double real;
  1282.               double imag;
  1283.           }
  1284.  
  1285.      As with `whatis', using `ptype' without an argument refers to the
  1286.      type of `$', the last value in the value history.
  1287.  
  1288. `info types REGEXP'
  1289. `info types'
  1290.      Print a brief description of all types whose name matches REGEXP
  1291.      (or all types in your program, if you supply no argument).  Each
  1292.      complete typename is matched as though it were a complete line;
  1293.      thus, `i type value' gives information on all types in your
  1294.      program whose name includes the string `value', but `i type
  1295.      ^value$' gives information only on types whose complete name is
  1296.      `value'.
  1297.  
  1298.      This command differs from `ptype' in two ways: first, like
  1299.      `whatis', it does not print a detailed description; second, it
  1300.      lists all source files where a type is defined.
  1301.  
  1302. `info source'
  1303.      Show the name of the current source file--that is, the source file
  1304.      for the function containing the current point of execution--and
  1305.      the language it was written in.
  1306.  
  1307. `info sources'
  1308.      Print the names of all source files in your program for which
  1309.      there is debugging information, organized into two lists: files
  1310.      whose symbols have already been read, and files whose symbols will
  1311.      be read when needed.
  1312.  
  1313. `info functions'
  1314.      Print the names and data types of all defined functions.
  1315.  
  1316. `info functions REGEXP'
  1317.      Print the names and data types of all defined functions whose
  1318.      names contain a match for regular expression REGEXP.  Thus, `info
  1319.      fun step' finds all functions whose names include `step'; `info
  1320.      fun ^step' finds those whose names start with `step'.
  1321.  
  1322. `info variables'
  1323.      Print the names and data types of all variables that are declared
  1324.      outside of functions (i.e., excluding local variables).
  1325.  
  1326. `info variables REGEXP'
  1327.      Print the names and data types of all variables (except for local
  1328.      variables) whose names contain a match for regular expression
  1329.      REGEXP.
  1330.  
  1331. `maint print symbols FILENAME'
  1332. `maint print psymbols FILENAME'
  1333. `maint print msymbols FILENAME'
  1334.      Write a dump of debugging symbol data into the file FILENAME.
  1335.      These commands are used to debug the GDB symbol-reading code.  Only
  1336.      symbols with debugging data are included.  If you use `maint print
  1337.      symbols', GDB includes all the symbols for which it has already
  1338.      collected full details: that is, FILENAME reflects symbols for
  1339.      only those files whose symbols GDB has read.  You can use the
  1340.      command `info sources' to find out which files these are.  If you
  1341.      use `maint print psymbols' instead, the dump shows information
  1342.      about symbols that GDB only knows partially--that is, symbols
  1343.      defined in files that GDB has skimmed, but not yet read
  1344.      completely.  Finally, `maint print msymbols' dumps just the
  1345.      minimal symbol information required for each object file from
  1346.      which GDB has read some symbols.  The description of `symbol-file'
  1347.      explains how GDB reads symbols; both `info source' and
  1348.      `symbol-file' are described in *Note Commands to specify files:
  1349.      Files.
  1350.  
  1351.