1) Added conditionals around node structure, giving clean nodes for either
[deliverable/binutils-gdb.git] / gdb / doc / gdb.symb-m4
CommitLineData
9bcc06ef
RP
1_dnl__ -*- Texinfo -*-
2_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
3_dnl__ This file is part of the source for the GDB manual.
4_dnl__ $Id$
5@node Symbols, Altering, Data, Top
6@chapter Examining the Symbol Table
7
8The commands described in this section allow you to inquire about the
9symbols (names of variables, functions and types) defined in your
10program. This information is inherent in the text of your program and
11does not change as the program executes. _GDBN__ finds it in your
12program's symbol table, in the file indicated when you started _GDBN__
13(@pxref{File Options}), or by one of the file-management commands
14(@pxref{Files}).
15
16@table @code
17@item info address @var{symbol}
18@kindex info address
19Describe where the data for @var{symbol} is stored. For a register
20variable, this says which register it is kept in. For a non-register
21local variable, this prints the stack-frame offset at which the variable
22is always stored.
23
24Note the contrast with @samp{print &@var{symbol}}, which does not work
25at all for a register variables, and for a stack local variable prints
26the exact address of the current instantiation of the variable.
27
28@item whatis @var{exp}
29@kindex whatis
30Print the data type of expression @var{exp}. @var{exp} is not
31actually evaluated, and any side-effecting operations (such as
32assignments or function calls) inside it do not take place.
33@xref{Expressions}.
34
35@item whatis
36Print the data type of @code{$}, the last value in the value history.
37
38@item ptype @var{typename}
39@kindex ptype
40Print a description of data type @var{typename}. @var{typename} may be
41the name of a type, or for C code it may have the form
42@samp{struct @var{struct-tag}}, @samp{union @var{union-tag}} or
43@samp{enum @var{enum-tag}}.@refill
44
45@item ptype @var{exp}
46Print a description of the type of expression @var{exp}. @code{ptype}
47differs from @code{whatis} by printing a detailed description, instead of just
48the name of the type. For example, if your program declares a variable
49as
50@example
51struct complex {double real; double imag;} v;
52@end example
53@noindent
54compare the output of the two commands:
55@example
56(_GDBP__) whatis v
57type = struct complex
58(_GDBP__) ptype v
59type = struct complex {
60 double real;
61 double imag;
62}
63@end example
64
65@item info types @var{regexp}
66@itemx info types
67@kindex info types
68Print a brief description of all types whose name matches @var{regexp}
69(or all types in your program, if you supply no argument). Each
70complete typename is matched as though it were a complete line; thus,
71@samp{i type value} gives information on all types in your program whose
72name includes the string @code{value}, but @samp{i type ^value$} gives
73information only on types whose complete name is @code{value}.
74
75This command differs from @code{ptype} in two ways: first, like
76@code{whatis}, it does not print a detailed description; second, it
77lists all source files where a type is defined.
78
79@item info source
80@kindex info source
81Show the name of the current source file---that is, the source file for
82the function containing the current point of execution.
83
84@item info sources
85@kindex info sources
86Print the names of all source files in the program for which there is
87debugging information, organized into two lists: those for which symbols
88have been read in, and those for which symbols will be read in on
89demand.
90@c FIXME: above passive AND awkward!
91
92@item info functions
93@kindex info functions
94Print the names and data types of all defined functions.
95
96@item info functions @var{regexp}
97Print the names and data types of all defined functions
98whose names contain a match for regular expression @var{regexp}.
99Thus, @samp{info fun step} finds all functions whose names
100include @code{step}; @samp{info fun ^step} finds those whose names
101start with @code{step}.
102
103@item info variables
104@kindex info variables
105Print the names and data types of all variables that are declared
106outside of functions (i.e., excluding local variables).
107
108@item info variables @var{regexp}
109Print the names and data types of all variables (except for local
110variables) whose names contain a match for regular expression
111@var{regexp}.
112
113
114@ignore
115This was never implemented.
116@item info methods
117@itemx info methods @var{regexp}
118@kindex info methods
119The @code{info methods} command permits the user to examine all defined
120methods within C++ program, or (with the @var{regexp} argument) a
121specific set of methods found in the various C++ classes. Many
122C++ classes provide a large number of methods. Thus, the output
123from the @code{ptype} command can be overwhelming and hard to use. The
124@code{info-methods} command filters the methods, printing only those
125which match the regular-expression @var{regexp}.
126@end ignore
127
128@item printsyms @var{filename}
129@kindex printsyms
130Write a complete dump of the debugger's symbol data into the
131file @var{filename}.
132@end table
This page took 0.03153 seconds and 4 git commands to generate.