Next: Symbol Tables In Guile, Previous: Blocks In Guile, Up: Guile API [Contents][Index]
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:
#t
if object
is an object of type <gdb:symbol>
. Otherwise return #f
.#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.symbol
or #f
if no type is recorded. The result is an object of type <gdb:type>
. See Types In Guile.symbol
appears. The result is an object of type <gdb:symtab>
. See Symbol Tables In Guile.symbol
was defined. This is an integer.symbol
as a string.symbol
, as used by the linker (i.e., may be mangled).symbol
in a form suitable for output. This is either name
or linkage_name
, depending on whether the user asked GDB to display demangled or mangled names.(gdb)
module and described later in this chapter.#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.#t
if symbol
is an argument of a function. Otherwise return #f
.#t
if symbol
is a constant. Otherwise return #f
.#t
if symbol
is a function or a method. Otherwise return #f
.#t
if symbol
is a variable. Otherwise return #f
.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_FUNCTIONS_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
Next: Symbol Tables In Guile, Previous: Blocks In Guile, Up: Guile API [Contents][Index]