86 Py_XDECREF (ps_self->
dict);
104 self->printers = PyList_New (0);
105 if (self->printers == NULL)
108 self->frame_filters = PyDict_New ();
109 if (self->frame_filters == NULL)
112 self->frame_unwinders = PyList_New (0);
113 if (self->frame_unwinders == NULL)
116 self->type_printers = PyList_New (0);
117 if (self->type_printers == NULL)
120 self->xmethods = PyList_New (0);
121 if (self->xmethods == NULL)
141 return (PyObject *)
self;
149 Py_INCREF (self->printers);
150 return self->printers;
161 PyErr_SetString (PyExc_TypeError,
162 "cannot delete the pretty_printers attribute");
166 if (! PyList_Check (value))
168 PyErr_SetString (PyExc_TypeError,
169 "the pretty_printers attribute must be a list");
174 tmp =
self->printers;
176 self->printers = value;
189 Py_INCREF (self->frame_filters);
190 return self->frame_filters;
202 PyErr_SetString (PyExc_TypeError,
203 "cannot delete the frame filter attribute");
207 if (! PyDict_Check (frame))
209 PyErr_SetString (PyExc_TypeError,
210 "the frame filter attribute must be a dictionary");
215 tmp =
self->frame_filters;
217 self->frame_filters = frame;
230 Py_INCREF (self->frame_unwinders);
231 return self->frame_unwinders;
244 PyErr_SetString (PyExc_TypeError,
245 "cannot delete the frame unwinders list");
249 if (!PyList_Check (unwinders))
251 PyErr_SetString (PyExc_TypeError,
252 "the frame unwinders attribute must be a list");
257 tmp =
self->frame_unwinders;
258 Py_INCREF (unwinders);
259 self->frame_unwinders = unwinders;
272 Py_INCREF (self->type_printers);
273 return self->type_printers;
283 Py_INCREF (self->xmethods);
284 return self->xmethods;
297 PyErr_SetString (PyExc_TypeError,
298 "cannot delete the type_printers attribute");
302 if (! PyList_Check (value))
304 PyErr_SetString (PyExc_TypeError,
305 "the type_printers attribute must be a list");
310 tmp =
self->type_printers;
312 self->type_printers = value;
339 object->pspace = NULL;
366 object->pspace = pspace;
371 return (PyObject *) object;
378 = register_program_space_data_with_cleanup (NULL,
py_free_pspace);
394 "The progspace's main filename, or None.", NULL },
396 "Pretty printers.", NULL },
398 "Frame filters.", NULL },
400 "Frame unwinders.", NULL },
402 "Type printers.", NULL },
404 "Debug methods.", NULL },
430 "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 int pspy_initialize(pspace_object *self)
static const struct program_space_data * pspy_pspace_data_key
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
struct cleanup * ensure_python_env(struct gdbarch *gdbarch, const struct language_defn *language)
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)
const char * host_charset(void)
static PyGetSetDef pspace_getset[]
PyObject * pspace_to_pspace_object(struct program_space *pspace)
PyObject * pspy_get_printers(PyObject *o, void *ignore)
void do_cleanups(struct cleanup *old_chain)
static void pspy_dealloc(PyObject *self)
#define PyVarObject_HEAD_INIT(type, size)