DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(gdb) Data

Info Catalog (gdb) Source (gdb) Top (gdb) Languages
 
 Examining Data
 **************
 
    The usual way to examine data in your program is with the `print'
 command (abbreviated `p'), or its synonym `inspect'.  It evaluates and
 prints the value of an expression of the language your program is
 written in ( Using GDB with Different Languages Languages.).
 
 `print EXPR'
 `print /F EXPR'
      EXPR is an expression (in the source language).  By default the
      value of EXPR is printed in a format appropriate to its data type;
      you can choose a different format by specifying `/F', where F is a
      letter specifying the format; see  Output formats Output
      Formats.
 
 `print'
 `print /F'
      If you omit EXPR, GDB displays the last value again (from the
      "value history";  Value history Value History.).  This
      allows you to conveniently inspect the same value in an
      alternative format.
 
    A more low-level way of examining data is with the `x' command.  It
 examines data in memory at a specified address and prints it in a
 specified format.   Examining memory Memory.
 
    If you are interested in information about types, or about how the
 fields of a struct or a class are declared, use the `ptype EXP' command
 rather than `print'.   Examining the Symbol Table Symbols.
 

Menu

 
* Expressions                 Expressions
* Variables                   Program variables
* Arrays                      Artificial arrays
* Output Formats              Output formats
* Memory                      Examining memory
* Auto Display                Automatic display
* Print Settings              Print settings
* Value History               Value history
* Convenience Vars            Convenience variables
* Registers                   Registers
* Floating Point Hardware     Floating point hardware
 
Info Catalog (gdb) Source (gdb) Top (gdb) Languages
automatically generated byinfo2html