From: Tom Tromey Date: Thu, 30 May 2013 17:16:05 +0000 (+0000) Subject: fix py-frame.c X-Git-Tag: cygwin-1_7_19-release~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af1c6971291cbc55ad9f3dc1dec7fd86f7f5be2f;p=external%2Fbinutils.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2588d05..d5a5452 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-05-30 Tom Tromey + * python/py-frame.c (frapy_read_var): Call do_cleanups along + all return paths. + +2013-05-30 Tom Tromey + * python/py-breakpoint.c (bppy_get_commands): Call do_cleanups along all return paths. 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) {