58 #define BLPY_REQUIRE_VALID(block_obj, block) \ 60 block = block_object_to_block (block_obj); \ 63 PyErr_SetString (PyExc_RuntimeError, \ 64 _("Block is invalid.")); \ 71 #define BLPY_ITER_REQUIRE_VALID(block_obj) \ 73 if (block_obj->block == NULL) \ 75 PyErr_SetString (PyExc_RuntimeError, \ 76 _("Source block for iterator is invalid.")); \ 95 if (block_iter_obj == NULL)
103 return (PyObject *) block_iter_obj;
145 const struct block *super_block;
182 const struct block *static_block;
235 else if (
block->objfile)
280 return (PyObject *) block_obj;
324 PyErr_SetString (PyExc_StopIteration,
_(
"Symbol is null."));
336 Py_XDECREF (iter_obj->
source);
396 PyErr_SetString (PyExc_RuntimeError,
397 _(
"Cannot locate object file for block."));
459 "is_valid () -> Boolean.\n\ 460 Return true if this block is valid, false if not." },
465 {
"start",
blpy_get_start, NULL,
"Start address of the block.", NULL },
466 {
"end",
blpy_get_end, NULL,
"End address of the block.", NULL },
468 "Symbol that names the block, or None.", NULL },
470 "Block containing the block, or None.", NULL },
472 "Block containing the global block.", NULL },
474 "Block containing the static block.", NULL },
476 "Whether this block is a static block.", NULL },
478 "Whether this block is a global block.", NULL },
502 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,
517 "is_valid () -> Boolean.\n\ 518 Return true if this block iterator is valid, false if not." },
542 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,
543 "GDB block syms iterator object",
static void set_block(block_object *obj, const struct block *block, struct objfile *objfile)
int gdb_pymodule_addobject(PyObject *module, const char *name, PyObject *object)
struct symbol * block_iterator_next(struct block_iterator *iterator)
static PyObject * blpy_is_valid(PyObject *self, PyObject *args)
PyTypeObject block_syms_iterator_object_type
PyTypeObject block_syms_iterator_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF("block_syms_iterator_object")
struct block_iterator iter
PyObject * block_to_block_object(const struct block *block, struct objfile *objfile)
#define BLPY_ITER_REQUIRE_VALID(block_obj)
static PyObject * blpy_get_global_block(PyObject *self, void *closure)
static PyObject * blpy_get_end(PyObject *self, void *closure)
static PyObject * blpy_iter(PyObject *self)
const struct block * block_global_block(const struct block *block)
unsigned long gdb_py_ulongest
PyTypeObject block_object_type
static PyObject * blpy_block_syms_iter(PyObject *self)
static PyMethodDef block_iterator_object_methods[]
int gdbpy_initialize_blocks(void)
static PyObject * blpy_is_static(PyObject *self, void *closure)
#define PyVarObject_HEAD_INIT(type, size)
const struct block * block_for_pc(CORE_ADDR pc)
static PyObject * blpy_get_function(PyObject *self, void *closure)
#define BLOCK_FUNCTION(bl)
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)
#define GDB_PY_HANDLE_EXCEPTION(Exception)
static void del_objfile_blocks(struct objfile *objfile, void *datum)
struct blpy_block_object block_object
#define CATCH(EXCEPTION, MASK)
static const struct objfile_data * blpy_objfile_data_key
static PyObject * blpy_get_superblock(PyObject *self, void *closure)
PyObject * gdbpy_block_for_pc(PyObject *self, PyObject *args)
const struct block * block_object_to_block(PyObject *obj)
#define BLOCK_SUPERBLOCK(bl)
struct blpy_block_object * source
struct compunit_symtab * next
struct blpy_block_object * next
static PyObject * blpy_get_static_block(PyObject *self, void *closure)
static void blpy_dealloc(PyObject *obj)
static PyObject * blpy_get_start(PyObject *self, void *closure)
PyObject * gdb_py_object_from_ulongest(ULONGEST l)
PyObject_HEAD const struct block * block
const struct block * block_static_block(const struct block *block)
#define COMPUNIT_OBJFILE(cust)
static PyObject * blpy_iter_is_valid(PyObject *self, PyObject *args)
PyObject_HEAD const struct block * block
struct symbol * block_iterator_first(const struct block *block, struct block_iterator *iterator)
PyObject * symbol_to_symbol_object(struct symbol *sym)
#define BLPY_REQUIRE_VALID(block_obj, block)
static PyObject * blpy_is_global(PyObject *self, void *closure)
static PyObject * blpy_block_syms_iternext(PyObject *self)
static gdb_PyGetSetDef block_object_getset[]
struct blpy_block_object * prev
static PyMethodDef block_object_methods[]
static void blpy_block_syms_dealloc(PyObject *obj)