This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 18/40] fix py-breakpoint.c
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:51:36 -0600
- Subject: [PATCH 18/40] fix py-breakpoint.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
One return path in bppy_get_commands was missing a do_cleanups call.
* python/py-breakpoint.c (bppy_get_commands): Call do_cleanups
along all return paths.
---
gdb/python/py-breakpoint.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 5e5f9b3..d099892 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -489,7 +489,11 @@ bppy_get_commands (PyObject *self, void *closure)
print_command_lines (current_uiout, breakpoint_commands (bp), 0);
}
ui_out_redirect (current_uiout, NULL);
- GDB_PY_HANDLE_EXCEPTION (except);
+ if (except.reason < 0)
+ {
+ do_cleanups (chain);
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
cmdstr = ui_file_xstrdup (string_file, &length);
make_cleanup (xfree, cmdstr);
--
1.8.1.4