fix py-breakpoint.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:14:35 +0000 (17:14 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:14:35 +0000 (17:14 +0000)
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/ChangeLog
gdb/python/py-breakpoint.c

index 5b9e8ddfc9e1e2888ee58b5e690c045a53fc73b2..2588d05ec468022b4fbf45bbed6806a26eb311a0 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-30  Tom Tromey  <tromey@redhat.com>
+
+       * python/py-breakpoint.c (bppy_get_commands): Call do_cleanups
+       along all return paths.
+
 2013-05-30  Tom Tromey  <tromey@redhat.com>
 
        * cli/cli-logging.c (set_logging_redirect): Unconditionally
index d958f3033416a8f0cd346c66020036c1e80b3208..eaa1bc5273879cc2813057674c48e91b7d02048e 100644 (file)
@@ -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);