47 #define STPY_REQUIRE_VALID(symtab_obj, symtab) \ 49 symtab = symtab_object_to_symtab (symtab_obj); \ 52 PyErr_SetString (PyExc_RuntimeError, \ 53 _("Symbol Table is invalid.")); \ 78 #define SALPY_REQUIRE_VALID(sal_obj, sal) \ 80 sal = sal_object_to_symtab_and_line (sal_obj); \ 83 PyErr_SetString (PyExc_RuntimeError, \ 84 _("Symbol Table and Line is invalid.")); \ 152 const char *fullname;
238 s =
xstrprintf (
"symbol and line for %s, line %d", filename,
241 result = PyString_FromString (s);
298 return PyInt_FromLong (sal->
line);
309 Py_INCREF (self_sal->
symtab);
311 return (PyObject *) self_sal->
symtab;
345 Py_TYPE (
self)->tp_free (
self);
363 if (symtab_obj == NULL)
375 sal_obj->
symtab = symtab_obj;
376 sal_obj->
prev = NULL;
393 sal_obj->
next = NULL;
432 return (PyObject *) symtab_obj;
447 return (PyObject *) sal_obj.
release ();
549 "The symbol table's source filename.", NULL },
553 "The name/version of the program that compiled this symtab.", NULL },
559 "is_valid () -> Boolean.\n\ 560 Return true if this symbol table is valid, false if not." },
562 "fullname () -> String.\n\ 563 Return the symtab's full source filename." },
565 "global_block () -> gdb.Block.\n\ 566 Return the global block of the symbol table." },
568 "static_block () -> gdb.Block.\n\ 569 Return the static block of the symbol table." },
571 "linetable () -> gdb.LineTable.\n\ 572 Return the LineTable associated with this symbol table" },
611 {
"pc",
salpy_get_pc, NULL,
"Return the symtab_and_line's pc.", NULL },
613 "Return the symtab_and_line's last address.", NULL },
615 "Return the symtab_and_line's line.", NULL },
621 "is_valid () -> Boolean.\n\ 622 Return true if this symbol table and line is valid, false if not." },
628 "gdb.Symtab_and_line",
647 "GDB symtab_and_line object",
int gdb_pymodule_addobject(PyObject *module, const char *name, PyObject *object)
static PyObject * salpy_get_pc(PyObject *self, void *closure)
struct symtab_and_line * sal
const char * symtab_to_filename_for_display(struct symtab *symtab)
#define SYMTAB_COMPUNIT(symtab)
PyObject * block_to_block_object(const struct block *block, struct objfile *objfile)
PyObject * symtab_and_line_to_sal_object(struct symtab_and_line sal)
static const struct objfile_data * salpy_objfile_data_key
static PyObject * stpy_fullname(PyObject *self, PyObject *args)
struct salpy_sal_object sal_object
#define SALPY_REQUIRE_VALID(sal_obj, sal)
static void salpy_dealloc(PyObject *self)
static PyObject * stpy_get_filename(PyObject *self, void *closure)
static PyObject * stpy_get_objfile(PyObject *self, void *closure)
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION set_sal(sal_object *sal_obj, struct symtab_and_line sal)
#define gdb_py_long_from_ulongest
struct stpy_symtab_object * next
#define BLOCKVECTOR_BLOCK(blocklist, n)
PyObject * symtab_to_linetable_object(PyObject *symtab)
#define PyVarObject_HEAD_INIT(type, size)
static void del_objfile_sal(struct objfile *objfile, void *datum)
static PyObject * stpy_static_block(PyObject *self, PyObject *args)
static void set_symtab(symtab_object *obj, struct symtab *symtab)
PyObject * symtab_to_symtab_object(struct symtab *symtab)
const char * symtab_to_fullname(struct symtab *s)
PyTypeObject sal_object_type
#define SYMTAB_BLOCKVECTOR(symtab)
PyObject * host_string_to_python_string(const char *str)
PyObject_HEAD symtab_object * symtab
static gdb_PyGetSetDef symtab_object_getset[]
#define SYMTAB_OBJFILE(symtab)
struct symtab * symtab_object_to_symtab(PyObject *obj)
PyObject * objfile_to_objfile_object(struct objfile *objfile)
#define COMPUNIT_PRODUCER(cust)
PyTypeObject symtab_object_type
static PyObject * salpy_get_last(PyObject *self, void *closure)
static PyObject * salpy_str(PyObject *self)
char * xstrprintf(const char *format,...)
static PyObject * stpy_get_linetable(PyObject *self, PyObject *args)
static PyMethodDef sal_object_methods[]
#define CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
struct stpy_symtab_object symtab_object
static PyObject * stpy_is_valid(PyObject *self, PyObject *args)
struct symtab_and_line * sal_object_to_symtab_and_line(PyObject *obj)
static PyObject * salpy_get_line(PyObject *self, void *closure)
struct salpy_sal_object * next
static PyMethodDef symtab_object_methods[]
static PyObject * salpy_is_valid(PyObject *self, PyObject *args)
int gdbpy_initialize_symtabs(void)
static const struct objfile_data * stpy_objfile_data_key
static void stpy_dealloc(PyObject *obj)
PyObject_HEAD struct symtab * symtab
static void del_objfile_symtab(struct objfile *objfile, void *datum)
static PyObject * stpy_global_block(PyObject *self, PyObject *args)
static gdb_PyGetSetDef sal_object_getset[]
struct salpy_sal_object * prev
static PyObject * stpy_str(PyObject *self)
PyTypeObject symtab_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF("symtab_object")
#define STPY_REQUIRE_VALID(symtab_obj, symtab)
static PyObject * salpy_get_symtab(PyObject *self, void *closure)
static PyObject * stpy_get_producer(PyObject *self, void *closure)
struct stpy_symtab_object * prev