GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
py-symbol.c File Reference
#include "defs.h"
#include "block.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
 

Macros

#define SYMPY_REQUIRE_VALID(symbol_obj, symbol)
 

Typedefs

typedef struct sympy_symbol_object symbol_object
 

Functions

static PyObject * sympy_str (PyObject *self)
 
static PyObject * sympy_get_type (PyObject *self, void *closure)
 
static PyObject * sympy_get_symtab (PyObject *self, void *closure)
 
static PyObject * sympy_get_name (PyObject *self, void *closure)
 
static PyObject * sympy_get_linkage_name (PyObject *self, void *closure)
 
static PyObject * sympy_get_print_name (PyObject *self, void *closure)
 
static PyObject * sympy_get_addr_class (PyObject *self, void *closure)
 
static PyObject * sympy_is_argument (PyObject *self, void *closure)
 
static PyObject * sympy_is_constant (PyObject *self, void *closure)
 
static PyObject * sympy_is_function (PyObject *self, void *closure)
 
static PyObject * sympy_is_variable (PyObject *self, void *closure)
 
static PyObject * sympy_needs_frame (PyObject *self, void *closure)
 
static PyObject * sympy_line (PyObject *self, void *closure)
 
static PyObject * sympy_is_valid (PyObject *self, PyObject *args)
 
static PyObject * sympy_value (PyObject *self, PyObject *args)
 
static void set_symbol (symbol_object *obj, struct symbol *symbol)
 
PyObject * symbol_to_symbol_object (struct symbol *sym)
 
struct symbolsymbol_object_to_symbol (PyObject *obj)
 
static void sympy_dealloc (PyObject *obj)
 
PyObject * gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
 
PyObject * gdbpy_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 const struct objfile_data * sympy_objfile_data_key
 
static PyGetSetDef symbol_object_getset []
 
static PyMethodDef symbol_object_methods []
 
PyTypeObject symbol_object_type
 

Macro Definition 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)
#define _(String)
Definition: gdb_locale.h:40
struct symbol * symbol_object_to_symbol(PyObject *obj)
Definition: py-symbol.c:332
Definition: symtab.h:703
return
Definition: gnu-nat.c:1865

Definition at line 41 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
int gdbpy_initialize_symbols ( void  )
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)

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

References symbol_object_type.

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

PyObject* symbol_to_symbol_object ( struct symbol sym)
static void sympy_dealloc ( PyObject *  obj)
static
static PyObject* sympy_get_addr_class ( PyObject *  self,
void *  closure 
)
static

Definition at line 127 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 107 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 97 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 117 of file py-symbol.c.

References SYMPY_REQUIRE_VALID, and sympy_str().

static PyObject* sympy_get_symtab ( PyObject *  self,
void *  closure 
)
static
static PyObject* sympy_get_type ( PyObject *  self,
void *  closure 
)
static

Definition at line 68 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 137 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 147 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 160 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 231 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 218 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 55 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 }
}
static PyObject * sympy_get_linkage_name(PyObject *self, void *closure)
Definition: py-symbol.c:107
static PyObject * sympy_get_addr_class(PyObject *self, void *closure)
Definition: py-symbol.c:127
static PyObject * sympy_line(PyObject *self, void *closure)
Definition: py-symbol.c:218
static PyObject * sympy_is_function(PyObject *self, void *closure)
Definition: py-symbol.c:160
static PyObject * sympy_is_variable(PyObject *self, void *closure)
Definition: py-symbol.c:173
static PyObject * sympy_get_name(PyObject *self, void *closure)
Definition: py-symbol.c:97
static PyObject * sympy_get_symtab(PyObject *self, void *closure)
Definition: py-symbol.c:84
static PyObject * sympy_get_print_name(PyObject *self, void *closure)
Definition: py-symbol.c:117
static PyObject * sympy_is_constant(PyObject *self, void *closure)
Definition: py-symbol.c:147
static PyObject * sympy_is_argument(PyObject *self, void *closure)
Definition: py-symbol.c:137
static PyObject * sympy_get_type(PyObject *self, void *closure)
Definition: py-symbol.c:68
static PyObject * sympy_needs_frame(PyObject *self, void *closure)
Definition: py-symbol.c:192

Definition at line 559 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}
}
static PyObject * sympy_value(PyObject *self, PyObject *args)
Definition: py-symbol.c:246
static PyObject * sympy_is_valid(PyObject *self, PyObject *args)
Definition: py-symbol.c:231

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

PyTypeObject symbol_object_type
const struct objfile_data* sympy_objfile_data_key
static

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

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