aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:16:05 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:16:05 +0000
commitaf1c6971291cbc55ad9f3dc1dec7fd86f7f5be2f (patch)
tree07173d39106b7e0ed301eec19efcf4dd0fc5f8f2 /gdb/python
parentb862ce75d2a1ac6b86812c7e512152e154e83ea6 (diff)
downloadgdb-af1c6971291cbc55ad9f3dc1dec7fd86f7f5be2f.zip
gdb-af1c6971291cbc55ad9f3dc1dec7fd86f7f5be2f.tar.gz
gdb-af1c6971291cbc55ad9f3dc1dec7fd86f7f5be2f.tar.bz2
fix py-frame.c
A couple return paths in frapy_read_var were missing do_cleanups calls. * python/py-frame.c (frapy_read_var): Call do_cleanups along all return paths.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-frame.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index c29d626..2615ddf 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -461,6 +461,7 @@ frapy_read_var (PyObject *self, PyObject *args)
{
PyErr_SetString (PyExc_RuntimeError,
_("Second argument must be block."));
+ do_cleanups (cleanup);
return NULL;
}
}
@@ -473,7 +474,11 @@ frapy_read_var (PyObject *self, PyObject *args)
block = get_frame_block (frame, NULL);
var = lookup_symbol (var_name, block, VAR_DOMAIN, NULL);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ if (except.reason < 0)
+ {
+ do_cleanups (cleanup);
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
if (!var)
{