Use gdbpy_enter in py-finishbreakpoint.c
authorTom Tromey <tom@tromey.com>
Mon, 7 Nov 2016 23:03:10 +0000 (16:03 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 11 Jan 2017 02:13:40 +0000 (19:13 -0700)
Change py-finishbreakpoint.c to use gdbpy_enter.

2017-01-10  Tom Tromey  <tom@tromey.com>

* python/py-finishbreakpoint.c (bpfinishpy_handle_stop)
(bpfinishpy_handle_exit): Use gdbpy_enter.

gdb/ChangeLog
gdb/python/py-finishbreakpoint.c

index f02b2354af61273c2301ad8845ef3eafec37715e..ab19c41765d1cc4f38c61bc40305df566d7b360f 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-10  Tom Tromey  <tom@tromey.com>
+
+       * python/py-finishbreakpoint.c (bpfinishpy_handle_stop)
+       (bpfinishpy_handle_exit): Use gdbpy_enter.
+
 2017-01-10  Tom Tromey  <tom@tromey.com>
 
        * python/py-cmd.c (cmdpy_destroyer)
index da39d28c0852ff37f341215decbb3544d638bb9f..4e49ec70fb3ea3d1de7a1760f6809a29df45f11b 100644 (file)
@@ -392,13 +392,10 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, void *args)
 static void
 bpfinishpy_handle_stop (struct bpstats *bs, int print_frame)
 {
-  struct cleanup *cleanup = ensure_python_env (get_current_arch (),
-                                               current_language);
+  gdbpy_enter enter_py (get_current_arch (), current_language);
 
   iterate_over_breakpoints (bpfinishpy_detect_out_scope_cb,
                             bs == NULL ? NULL : bs->breakpoint_at);
-
-  do_cleanups (cleanup);
 }
 
 /* Attached to `exit' notifications, triggers all the necessary out of
@@ -407,12 +404,9 @@ bpfinishpy_handle_stop (struct bpstats *bs, int print_frame)
 static void
 bpfinishpy_handle_exit (struct inferior *inf)
 {
-  struct cleanup *cleanup = ensure_python_env (target_gdbarch (),
-                                               current_language);
+  gdbpy_enter enter_py (target_gdbarch (), current_language);
 
   iterate_over_breakpoints (bpfinishpy_detect_out_scope_cb, NULL);
-
-  do_cleanups (cleanup);
 }
 
 /* Initialize the Python finish breakpoint code.  */