85 Py_XDECREF (ps_self->
dict);
102 self->dict = PyDict_New ();
103 if (self->dict == NULL)
106 self->printers = PyList_New (0);
107 if (self->printers == NULL)
110 self->frame_filters = PyDict_New ();
111 if (self->frame_filters == NULL)
114 self->frame_unwinders = PyList_New (0);
115 if (self->frame_unwinders == NULL)
118 self->type_printers = PyList_New (0);
119 if (self->type_printers == NULL)
122 self->xmethods = PyList_New (0);
123 if (self->xmethods == NULL)
140 return (PyObject *)
self.
release ();
148 Py_INCREF (self->printers);
149 return self->printers;
160 PyErr_SetString (PyExc_TypeError,
161 "cannot delete the pretty_printers attribute");
165 if (! PyList_Check (
value))
167 PyErr_SetString (PyExc_TypeError,
168 "the pretty_printers attribute must be a list");
173 tmp =
self->printers;
175 self->printers =
value;
188 Py_INCREF (self->frame_filters);
189 return self->frame_filters;
201 PyErr_SetString (PyExc_TypeError,
202 "cannot delete the frame filter attribute");
206 if (! PyDict_Check (frame))
208 PyErr_SetString (PyExc_TypeError,
209 "the frame filter attribute must be a dictionary");
214 tmp =
self->frame_filters;
216 self->frame_filters = frame;
229 Py_INCREF (self->frame_unwinders);
230 return self->frame_unwinders;
243 PyErr_SetString (PyExc_TypeError,
244 "cannot delete the frame unwinders list");
248 if (!PyList_Check (unwinders))
250 PyErr_SetString (PyExc_TypeError,
251 "the frame unwinders attribute must be a list");
256 tmp =
self->frame_unwinders;
257 Py_INCREF (unwinders);
258 self->frame_unwinders = unwinders;
271 Py_INCREF (self->type_printers);
272 return self->type_printers;
282 Py_INCREF (self->xmethods);
283 return self->xmethods;
296 PyErr_SetString (PyExc_TypeError,
297 "cannot delete the type_printers attribute");
301 if (! PyList_Check (
value))
303 PyErr_SetString (PyExc_TypeError,
304 "the type_printers attribute must be a list");
309 tmp =
self->type_printers;
311 self->type_printers =
value;
337 object->pspace = NULL;
358 object->pspace = pspace;
363 return (PyObject *)
object.release ();
370 = register_program_space_data_with_cleanup (NULL,
py_free_pspace);
386 "The progspace's main filename, or None.", NULL },
388 "Pretty printers.", NULL },
390 "Frame filters.", NULL },
392 "Frame unwinders.", NULL },
394 "Type printers.", NULL },
396 "Debug methods.", NULL },
422 "GDB progspace object",
struct gdbarch * target_gdbarch(void)
int gdb_pymodule_addobject(PyObject *module, const char *name, PyObject *object)
PyObject * gdb_py_generic_dict(PyObject *self, void *closure)
static PyObject * pspy_new(PyTypeObject *type, PyObject *args, PyObject *keywords)
static int pspy_set_printers(PyObject *o, PyObject *value, void *ignore)
static int pspy_set_type_printers(PyObject *o, PyObject *value, void *ignore)
struct objfile * symfile_object_file
struct program_space * pspace
PyObject * pspy_get_frame_filters(PyObject *o, void *ignore)
PyObject * pspy_get_xmethods(PyObject *o, void *ignore)
static gdb_PyGetSetDef pspace_getset[]
#define PyVarObject_HEAD_INIT(type, size)
static int pspy_initialize(pspace_object *self)
static const struct program_space_data * pspy_pspace_data_key
PyObject * host_string_to_python_string(const char *str)
static int pspy_set_frame_filters(PyObject *o, PyObject *frame, void *ignore)
PyTypeObject pspace_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF("pspace_object")
PyTypeObject pspace_object_type
const char * objfile_name(const struct objfile *objfile)
PyObject_HEAD struct program_space * pspace
static int pspy_set_frame_unwinders(PyObject *o, PyObject *unwinders, void *ignore)
int gdbpy_initialize_pspace(void)
const struct language_defn * current_language
static PyObject * pspy_get_filename(PyObject *self, void *closure)
PyObject * frame_unwinders
PyObject * pspy_get_frame_unwinders(PyObject *o, void *ignore)
static PyObject * pspy_get_type_printers(PyObject *o, void *ignore)
static void py_free_pspace(struct program_space *pspace, void *datum)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
PyObject * pspace_to_pspace_object(struct program_space *pspace)
PyObject * pspy_get_printers(PyObject *o, void *ignore)
static void pspy_dealloc(PyObject *self)