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
#tif object is an object of type<gdb:symbol>. Otherwise return#f.
Return
#tif the<gdb:symbol>object is valid,#fif 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
#fif 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
nameorlinkage_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
#tif evaluating symbol's value requires a frame (see Frames In Guile) and#fotherwise. Typically, local variables will require a frame, but other symbols will not.
Return
#tif symbol is an argument of a function. Otherwise return#f.
Return
#tif 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#fif the symbol is not found. If the symbol is found, the second element is#tif the symbol is a field of a method's object (e.g.,thisin 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#fif the symbol is not found.
The available domain categories in <gdb:symbol> are represented
as constants in the (gdb) module:
SYMBOL_UNDEF_DOMAINSYMBOL_VAR_DOMAINSYMBOL_STRUCT_DOMAINSYMBOL_LABEL_DOMAINSYMBOL_VARIABLES_DOMAINSYMBOLS_VAR_DOMAIN; it
contains everything minus functions and types.
SYMBOL_FUNCTION_DOMAINSYMBOL_TYPES_DOMAINThe available address class categories in <gdb:symbol> are represented
as constants in the gdb module:
SYMBOL_LOC_UNDEFSYMBOL_LOC_CONSTSYMBOL_LOC_STATICSYMBOL_LOC_REGISTERSYMBOL_LOC_ARGSYMBOL_LOC_REF_ARGLOC_ARG except that the value's address is stored at the
offset, not the value itself.
SYMBOL_LOC_REGPARM_ADDRLOC_REGISTER except
the register holds the address of the argument instead of the argument
itself.
SYMBOL_LOC_LOCALSYMBOL_LOC_TYPEDEFSYMBOL_STRUCT_DOMAIN all
have this class.
SYMBOL_LOC_BLOCKSYMBOL_LOC_CONST_BYTESSYMBOL_LOC_UNRESOLVEDSYMBOL_LOC_OPTIMIZED_OUTSYMBOL_LOC_COMPUTED