summaryrefslogtreecommitdiff
path: root/gdb/python/py-progspace.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2010-05-17 21:23:24 +0000
committerMichael Snyder <msnyder@specifix.com>2010-05-17 21:23:24 +0000
commit170e47f96ba50ff4490f2bad2b8cf4f4e43c23db (patch)
tree51c72cceadcbab961116cf53eef756e4dfaa3134 /gdb/python/py-progspace.c
parentd9bf14323312dd125063f69cf91853a4739b2621 (diff)
downloadgdb-170e47f96ba50ff4490f2bad2b8cf4f4e43c23db.tar.gz
2010-05-17 Michael Snyder <msnyder@vmware.com>
* python/py-auto-load.c: White space. * python/py-block.c: White space. * python/py-breakpoint.c: White space. * python/py-cmd.c: White space. * python/py-function.c: White space. * python/py-lazy-string.c: White space. * python/py-objfile.c: White space. * python/py-param.c: White space. * python/py-prettyprint.c: White space. * python/py-progspace.c: White space. * python/py-symtab.c: White space. * python/python.c: White space. * python/py-type.c: White space. * python/py-utils.c: White space. * python/py-value.c: White space.
Diffstat (limited to 'gdb/python/py-progspace.c')
-rw-r--r--gdb/python/py-progspace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index ead616ba1ed..87245328c83 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -47,9 +47,11 @@ static PyObject *
pspy_get_filename (PyObject *self, void *closure)
{
pspace_object *obj = (pspace_object *) self;
+
if (obj->pspace)
{
struct objfile *objfile = obj->pspace->symfile_object_file;
+
if (objfile && objfile->name)
return PyString_Decode (objfile->name, strlen (objfile->name),
host_charset (), NULL);
@@ -61,6 +63,7 @@ static void
pspy_dealloc (PyObject *self)
{
pspace_object *ps_self = (pspace_object *) self;
+
Py_XDECREF (ps_self->printers);
self->ob_type->tp_free (self);
}
@@ -69,6 +72,7 @@ static PyObject *
pspy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
{
pspace_object *self = (pspace_object *) type->tp_alloc (type, 0);
+
if (self)
{
self->pspace = NULL;
@@ -87,6 +91,7 @@ PyObject *
pspy_get_printers (PyObject *o, void *ignore)
{
pspace_object *self = (pspace_object *) o;
+
Py_INCREF (self->printers);
return self->printers;
}
@@ -96,6 +101,7 @@ pspy_set_printers (PyObject *o, PyObject *value, void *ignore)
{
PyObject *tmp;
pspace_object *self = (pspace_object *) o;
+
if (! value)
{
PyErr_SetString (PyExc_TypeError,