Next: Symbol Tables In Guile, Previous: Blocks In Guile, Up: Guile API
gdb represents every variable, function and type as an
entry in a symbol table. See Examining the Symbol Table.
Guile represents these symbols in gdb with the
<gdb:symbol>
object.
The following symbol-related procedures are provided by the
(gdb)
module:
Return
#t
if object is an object of type<gdb:symbol>
. Otherwise return#f
.
Return
#t
if the<gdb:symbol>
object is valid,#f
if not. A<gdb:symbol>
object can become invalid if the symbol it refers to does not exist in gdb any longer. All other<gdb:symbol>
procedures will throw an exception if it is invalid at the time the procedure is called.
Return the type of symbol or
#f
if no type is recorded. The result is an object of type<gdb:type>
. See Types In Guile.
Return the symbol table in which symbol appears. The result is an object of type
<gdb:symtab>
. See Symbol Tables In Guile.
Return the line number in the source code at which symbol was defined. This is an integer.
Return the name of symbol, as used by the linker (i.e., may be mangled).
Return the name of symbol in a form suitable for output. This is either
name
orlinkage_name
, depending on whether the user asked gdb to display demangled or mangled names.
Return the address class of the symbol. This classifies how to find the value of a symbol. Each address class is a constant defined in the
(gdb)
module and described later in this chapter.
Return
#t
if evaluating symbol's value requires a frame (see Frames In Guile) and#f
otherwise. Typically, local variables will require a frame, but other symbols will not.
Return
#t
if symbol is an argument of a function. Otherwise return#f
.
Return
#t
if symbol is a function or a method. Otherwise return#f
.
Compute the value of symbol, as a
<gdb:value>
. For functions, this computes the address of the function, cast to the appropriate type. If the symbol requires a frame in order to compute its value, then frame must be given. If frame is not given, or if frame is invalid, then an exception is thrown.
This function searches for a symbol by name. The search scope can be restricted to the parameters defined in the optional domain and block arguments.
name is the name of the symbol. It must be a string. The optional block argument restricts the search to symbols visible in that block. The block argument must be a
<gdb:block>
object. If omitted, the block for the current frame is used. The optional domain argument restricts the search to the domain type. The domain argument must be a domain constant defined in the(gdb)
module and described later in this chapter.The result is a list of two elements. The first element is a
<gdb:symbol>
object or#f
if the symbol is not found. If the symbol is found, the second element is#t
if the symbol is a field of a method's object (e.g.,this
in C++), otherwise it is#f
. If the symbol is not found, the second element is#f
.
This function searches for a global symbol by name. The search scope can be restricted by the domain argument.
name is the name of the symbol. It must be a string. The optional domain argument restricts the search to the domain type. The domain argument must be a domain constant defined in the
(gdb)
module and described later in this chapter.The result is a
<gdb:symbol>
object or#f
if the symbol is not found.
The available domain categories in <gdb:symbol>
are represented
as constants in the (gdb)
module:
SYMBOL_UNDEF_DOMAIN
SYMBOL_VAR_DOMAIN
SYMBOL_STRUCT_DOMAIN
SYMBOL_LABEL_DOMAIN
SYMBOL_VARIABLES_DOMAIN
SYMBOLS_VAR_DOMAIN
; it
contains everything minus functions and types.
SYMBOL_FUNCTION_DOMAIN
SYMBOL_TYPES_DOMAIN
The available address class categories in <gdb:symbol>
are represented
as constants in the gdb
module:
SYMBOL_LOC_UNDEF
SYMBOL_LOC_CONST
SYMBOL_LOC_STATIC
SYMBOL_LOC_REGISTER
SYMBOL_LOC_ARG
SYMBOL_LOC_REF_ARG
LOC_ARG
except that the value's address is stored at the
offset, not the value itself.
SYMBOL_LOC_REGPARM_ADDR
LOC_REGISTER
except
the register holds the address of the argument instead of the argument
itself.
SYMBOL_LOC_LOCAL
SYMBOL_LOC_TYPEDEF
SYMBOL_STRUCT_DOMAIN
all
have this class.
SYMBOL_LOC_BLOCK
SYMBOL_LOC_CONST_BYTES
SYMBOL_LOC_UNRESOLVED
SYMBOL_LOC_OPTIMIZED_OUT
SYMBOL_LOC_COMPUTED