GDB (xrefs)
Classes | Defines | Typedefs | Functions | Variables
/home/stan/gdb/src/gdb/python/py-symbol.c File Reference
#include "defs.h"
#include "block.h"
#include "exceptions.h"
#include "frame.h"
#include "symtab.h"
#include "python-internal.h"
#include "objfiles.h"

Go to the source code of this file.

Classes

struct  sympy_symbol_object

Defines

#define SYMPY_REQUIRE_VALID(symbol_obj, symbol)

Typedefs

typedef struct sympy_symbol_object symbol_object

Functions

static PyObjectsympy_str (PyObject *self)
static PyObjectsympy_get_type (PyObject *self, void *closure)
static PyObjectsympy_get_symtab (PyObject *self, void *closure)
static PyObjectsympy_get_name (PyObject *self, void *closure)
static PyObjectsympy_get_linkage_name (PyObject *self, void *closure)
static PyObjectsympy_get_print_name (PyObject *self, void *closure)
static PyObjectsympy_get_addr_class (PyObject *self, void *closure)
static PyObjectsympy_is_argument (PyObject *self, void *closure)
static PyObjectsympy_is_constant (PyObject *self, void *closure)
static PyObjectsympy_is_function (PyObject *self, void *closure)
static PyObjectsympy_is_variable (PyObject *self, void *closure)
static PyObjectsympy_needs_frame (PyObject *self, void *closure)
static PyObjectsympy_line (PyObject *self, void *closure)
static PyObjectsympy_is_valid (PyObject *self, PyObject *args)
static PyObjectsympy_value (PyObject *self, PyObject *args)
static void set_symbol (symbol_object *obj, struct symbol *symbol)
PyObjectsymbol_to_symbol_object (struct symbol *sym)
struct symbolsymbol_object_to_symbol (PyObject *obj)
static void sympy_dealloc (PyObject *obj)
PyObjectgdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
PyObjectgdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
static void del_objfile_symbols (struct objfile *objfile, void *datum)
int gdbpy_initialize_symbols (void)

Variables

static struct objfile_data * sympy_objfile_data_key
static PyGetSetDef symbol_object_getset []
static PyMethodDef symbol_object_methods []
PyTypeObject symbol_object_type

Define Documentation

#define SYMPY_REQUIRE_VALID (   symbol_obj,
  symbol 
)
Value:
do {                                                    \
    symbol = symbol_object_to_symbol (symbol_obj);      \
    if (symbol == NULL)                                 \
      {                                                 \
        PyErr_SetString (PyExc_RuntimeError,            \
                         _("Symbol is invalid."));      \
        return NULL;                                    \
      }                                                 \
  } while (0)

Definition at line 42 of file py-symbol.c.

Referenced by sympy_get_addr_class(), sympy_get_linkage_name(), sympy_get_name(), sympy_get_print_name(), sympy_get_symtab(), sympy_get_type(), sympy_is_argument(), sympy_is_constant(), sympy_is_function(), sympy_is_variable(), sympy_line(), sympy_needs_frame(), sympy_str(), and sympy_value().


Typedef Documentation


Function Documentation

static void del_objfile_symbols ( struct objfile objfile,
void *  datum 
) [static]
PyObject* gdbpy_lookup_global_symbol ( PyObject self,
PyObject args,
PyObject kw 
)
PyObject* gdbpy_lookup_symbol ( PyObject self,
PyObject args,
PyObject kw 
)
static void set_symbol ( symbol_object obj,
struct symbol symbol 
) [static]
struct symbol* symbol_object_to_symbol ( PyObject obj) [read]

Definition at line 324 of file py-symbol.c.

References symbol_object_type.

Referenced by extract_sym(), frapy_read_var(), and sympy_is_valid().

static void sympy_dealloc ( PyObject obj) [static]
static PyObject* sympy_get_addr_class ( PyObject self,
void *  closure 
) [static]

Definition at line 125 of file py-symbol.c.

References SYMBOL_CLASS, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_get_linkage_name ( PyObject self,
void *  closure 
) [static]

Definition at line 105 of file py-symbol.c.

References SYMBOL_LINKAGE_NAME, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_get_name ( PyObject self,
void *  closure 
) [static]

Definition at line 95 of file py-symbol.c.

References SYMBOL_NATURAL_NAME, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_get_print_name ( PyObject self,
void *  closure 
) [static]

Definition at line 115 of file py-symbol.c.

References SYMPY_REQUIRE_VALID, and sympy_str().

static PyObject* sympy_get_symtab ( PyObject self,
void *  closure 
) [static]

Definition at line 85 of file py-symbol.c.

References SYMBOL_SYMTAB, SYMPY_REQUIRE_VALID, and symtab_to_symtab_object().

static PyObject* sympy_get_type ( PyObject self,
void *  closure 
) [static]

Definition at line 69 of file py-symbol.c.

References SYMBOL_TYPE, SYMPY_REQUIRE_VALID, and type_to_type_object().

static PyObject* sympy_is_argument ( PyObject self,
void *  closure 
) [static]

Definition at line 135 of file py-symbol.c.

References SYMBOL_IS_ARGUMENT, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_is_constant ( PyObject self,
void *  closure 
) [static]

Definition at line 145 of file py-symbol.c.

References LOC_CONST, LOC_CONST_BYTES, SYMBOL_CLASS, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_is_function ( PyObject self,
void *  closure 
) [static]

Definition at line 158 of file py-symbol.c.

References LOC_BLOCK, SYMBOL_CLASS, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_is_valid ( PyObject self,
PyObject args 
) [static]

Definition at line 226 of file py-symbol.c.

References symbol_object_to_symbol().

static PyObject* sympy_is_variable ( PyObject self,
void *  closure 
) [static]
static PyObject* sympy_line ( PyObject self,
void *  closure 
) [static]

Definition at line 213 of file py-symbol.c.

References SYMBOL_LINE, and SYMPY_REQUIRE_VALID.

static PyObject* sympy_needs_frame ( PyObject self,
void *  closure 
) [static]
static PyObject* sympy_str ( PyObject self) [static]

Definition at line 56 of file py-symbol.c.

References SYMBOL_PRINT_NAME, and SYMPY_REQUIRE_VALID.

Referenced by sympy_get_print_name().

static PyObject* sympy_value ( PyObject self,
PyObject args 
) [static]

Variable Documentation

PyGetSetDef symbol_object_getset[] [static]
Initial value:
 {
  { "type", sympy_get_type, NULL,
    "Type of the symbol.", NULL },
  { "symtab", sympy_get_symtab, NULL,
    "Symbol table in which the symbol appears.", NULL },
  { "name", sympy_get_name, NULL,
    "Name of the symbol, as it appears in the source code.", NULL },
  { "linkage_name", sympy_get_linkage_name, NULL,
    "Name of the symbol, as used by the linker (i.e., may be mangled).",
    NULL },
  { "print_name", sympy_get_print_name, NULL,
    "Name of the symbol in a form suitable for output.\n\
This is either name or linkage_name, depending on whether the user asked GDB\n\
to display demangled or mangled names.", NULL },
  { "addr_class", sympy_get_addr_class, NULL, "Address class of the symbol." },
  { "is_argument", sympy_is_argument, NULL,
    "True if the symbol is an argument of a function." },
  { "is_constant", sympy_is_constant, NULL,
    "True if the symbol is a constant." },
  { "is_function", sympy_is_function, NULL,
    "True if the symbol is a function or method." },
  { "is_variable", sympy_is_variable, NULL,
    "True if the symbol is a variable." },
  { "needs_frame", sympy_needs_frame, NULL,
    "True if the symbol requires a frame for evaluation." },
  { "line", sympy_line, NULL,
    "The source line number at which the symbol was defined." },
  { NULL }  
}

Definition at line 540 of file py-symbol.c.

PyMethodDef symbol_object_methods[] [static]
Initial value:
 {
  { "is_valid", sympy_is_valid, METH_NOARGS,
    "is_valid () -> Boolean.\n\
Return true if this symbol is valid, false if not." },
  { "value", sympy_value, METH_VARARGS,
    "value ([frame]) -> gdb.Value\n\
Return the value of the symbol." },
  {NULL}  
}

Definition at line 570 of file py-symbol.c.

PyTypeObject symbol_object_type
struct objfile_data* sympy_objfile_data_key [static]

Definition at line 53 of file py-symbol.c.

Referenced by gdbpy_initialize_symbols(), set_symbol(), and sympy_dealloc().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines