home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gdb-4.14-src.lha / gdb-4.14 / gdb / gdb.info-4 < prev    next >
Encoding:
GNU Info File  |  1995-03-04  |  48.8 KB  |  1,348 lines

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