aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-10-15 15:23:47 +0000
committerTom Tromey <tromey@redhat.com>2012-10-15 15:23:47 +0000
commit801e41852339ac13d7d302c5e58de5d7f55d640b (patch)
tree418a29c7d96f3b1152db4c35dda87560ed73923f /gdb/python/py-symtab.c
parent74f910c87c017f1f232e7a8f67daafc8072c1089 (diff)
downloadgdb-801e41852339ac13d7d302c5e58de5d7f55d640b.zip
gdb-801e41852339ac13d7d302c5e58de5d7f55d640b.tar.gz
gdb-801e41852339ac13d7d302c5e58de5d7f55d640b.tar.bz2
PR python/14635:
* python/py-symtab.c (del_objfile_sal): Set 'symtab' field to Py_None. testsuite * gdb.python/py-symtab.exp: Test sal and symtab destructors.
Diffstat (limited to 'gdb/python/py-symtab.c')
-rw-r--r--gdb/python/py-symtab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c
index b6f45e6..21a172c 100644
--- a/gdb/python/py-symtab.c
+++ b/gdb/python/py-symtab.c
@@ -470,7 +470,10 @@ del_objfile_sal (struct objfile *objfile, void *datum)
{
sal_object *next = obj->next;
- obj->symtab = NULL;
+ Py_DECREF (obj->symtab);
+ obj->symtab = (symtab_object *) Py_None;
+ Py_INCREF (Py_None);
+
obj->next = NULL;
obj->prev = NULL;
xfree (obj->sal);