68#define STPY_REQUIRE_VALID(symtab_obj, symtab) \
70 symtab = symtab_object_to_symtab (symtab_obj); \
73 PyErr_SetString (PyExc_RuntimeError, \
74 _("Symbol Table is invalid.")); \
129#define SALPY_REQUIRE_VALID(sal_obj, sal) \
131 sal = sal_object_to_symtab_and_line (sal_obj); \
134 PyErr_SetString (PyExc_RuntimeError, \
135 _("Symbol Table and Line is invalid.")); \
200 const char *fullname;
281 if (sal_obj->
symtab == Py_None)
282 filename =
"<unknown>";
289 return PyUnicode_FromFormat (
"symbol and line for %s, line %d", filename,
306 Py_TYPE (obj)->tp_free (obj);
354 Py_INCREF (self_sal->
symtab);
381 else if (self_sal->
symtab != Py_None)
389 Py_DECREF (self_sal->
symtab);
391 Py_TYPE (self)->tp_free (self);
409 if (symtab_obj == NULL)
414 symtab_obj = Py_None;
421 sal_obj->
symtab = symtab_obj;
422 sal_obj->
prev = NULL;
426 if (sal_obj->
symtab != Py_None)
438 sal_obj->
next = NULL;
486 if (
set_sal (sal_obj.get (), sal) < 0)
490 return (
PyObject *) sal_obj.release ();
537 "The symbol table's source filename.", NULL },
541 "The name/version of the program that compiled this symtab.", NULL },
547 "is_valid () -> Boolean.\n\
548Return true if this symbol table is valid, false if not." },
550 "fullname () -> String.\n\
551Return the symtab's full source filename." },
553 "global_block () -> gdb.Block.\n\
554Return the global block of the symbol table." },
556 "static_block () -> gdb.Block.\n\
557Return the static block of the symbol table." },
559 "linetable () -> gdb.LineTable.\n\
560Return the LineTable associated with this symbol table" },
565 PyVarObject_HEAD_INIT (NULL, 0)
599 {
"pc",
salpy_get_pc, NULL,
"Return the symtab_and_line's pc.", NULL },
601 "Return the symtab_and_line's last address.", NULL },
603 "Return the symtab_and_line's line.", NULL },
609 "is_valid () -> Boolean.\n\
610Return true if this symbol table and line is valid, false if not." },
615 PyVarObject_HEAD_INIT (NULL, 0)
616 "gdb.Symtab_and_line",
635 "GDB symtab_and_line object",
void set(unsigned key, void *datum)
PyObject * block_to_block_object(const struct block *block, struct objfile *objfile)
PyObject * symtab_to_linetable_object(PyObject *symtab)
gdbpy_ref objfile_to_objfile_object(struct objfile *objfile)
gdb::ref_ptr< T, gdbpy_ref_policy< T > > gdbpy_ref
struct symtab * symtab_object_to_symtab(PyObject *obj)
static PyObject * stpy_str(PyObject *self)
static PyObject * salpy_get_last(PyObject *self, void *closure)
struct symtab_and_line * sal_object_to_symtab_and_line(PyObject *obj)
static gdb_PyGetSetDef sal_object_getset[]
static PyObject * stpy_get_producer(PyObject *self, void *closure)
static PyMethodDef symtab_object_methods[]
static PyObject * stpy_fullname(PyObject *self, PyObject *args)
PyTypeObject sal_object_type
PyObject * symtab_to_symtab_object(struct symtab *symtab)
static void stpy_dealloc(PyObject *obj)
PyObject * symtab_and_line_to_sal_object(struct symtab_and_line sal)
PyTypeObject symtab_object_type
static const registry< objfile >::key< symtab_object, stpy_deleter > stpy_objfile_data_key
static PyObject * salpy_is_valid(PyObject *self, PyObject *args)
static void salpy_dealloc(PyObject *self)
#define SALPY_REQUIRE_VALID(sal_obj, sal)
static PyObject * salpy_str(PyObject *self)
static PyObject * stpy_get_objfile(PyObject *self, void *closure)
static PyObject * stpy_get_filename(PyObject *self, void *closure)
static PyObject * salpy_get_symtab(PyObject *self, void *closure)
static PyObject * stpy_global_block(PyObject *self, PyObject *args)
static void set_symtab(symtab_object *obj, struct symtab *symtab)
static PyObject * salpy_get_line(PyObject *self, void *closure)
static PyObject * stpy_is_valid(PyObject *self, PyObject *args)
static PyObject * salpy_get_pc(PyObject *self, void *closure)
static gdb_PyGetSetDef symtab_object_getset[]
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_symtabs(void)
static const registry< objfile >::key< sal_object, salpy_deleter > salpy_objfile_data_key
static PyObject * stpy_get_linetable(PyObject *self, PyObject *args)
static PyMethodDef sal_object_methods[]
static PyObject * stpy_static_block(PyObject *self, PyObject *args)
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION set_sal(sal_object *sal_obj, struct symtab_and_line sal)
#define STPY_REQUIRE_VALID(symtab_obj, symtab)
gdbpy_ref host_string_to_python_string(const char *str)
gdbpy_ref gdb_py_object_from_longest(LONGEST l)
int gdb_pymodule_addobject(PyObject *module, const char *name, PyObject *object)
gdbpy_ref gdb_py_object_from_ulongest(ULONGEST l)
#define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF(ARG)
#define CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
#define GDBPY_INITIALIZE_FILE(INIT,...)
const char * symtab_to_fullname(struct symtab *s)
const char * symtab_to_filename_for_display(struct symtab *symtab)
struct block * static_block()
struct block * global_block()
struct blockvector * blockvector()
struct objfile * objfile() const
const char * producer() const
struct symtab_and_line * sal
PyObject_HEAD PyObject * symtab
void operator()(sal_object *obj)
void operator()(symtab_object *obj)
PyObject_HEAD struct symtab * symtab
struct compunit_symtab * compunit() const