]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
some fixes to infrun.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:37:50 +0000 (17:37 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:37:50 +0000 (17:37 +0000)
This fixes some of the problems in infrun.c that the checker reported.
I filed the remaining problems as bugs.

This patch is purely stylistic.

* infrun.c (adjust_pc_after_break): Introduce an outer null
cleanup.

gdb/ChangeLog
gdb/infrun.c

index 620af904677acee3f364a02bcbd455539da867a4..7adba7755aa529bace13d571fa61507501bc85d7 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-30  Tom Tromey  <tromey@redhat.com>
+
+       * infrun.c (adjust_pc_after_break): Introduce an outer null
+       cleanup.
+
 2013-05-30  Tom Tromey  <tromey@redhat.com>
 
        * mi/mi-cmd-var.c (varobj_update_one): Add an outer null cleanup.
index 376a440d46a0c5b346f10b1d567cc6099dd22520..151fdd83aee622fc9561075490ce679deeb6641f 100644 (file)
@@ -3027,10 +3027,10 @@ adjust_pc_after_break (struct execution_control_state *ecs)
   if (software_breakpoint_inserted_here_p (aspace, breakpoint_pc)
       || (non_stop && moribund_breakpoint_here_p (aspace, breakpoint_pc)))
     {
-      struct cleanup *old_cleanups = NULL;
+      struct cleanup *old_cleanups = make_cleanup (null_cleanup, NULL);
 
       if (RECORD_IS_USED)
-       old_cleanups = record_full_gdb_operation_disable_set ();
+       record_full_gdb_operation_disable_set ();
 
       /* When using hardware single-step, a SIGTRAP is reported for both
         a completed single-step and a software breakpoint.  Need to
@@ -3056,8 +3056,7 @@ adjust_pc_after_break (struct execution_control_state *ecs)
          || ecs->event_thread->prev_pc == breakpoint_pc)
        regcache_write_pc (regcache, breakpoint_pc);
 
-      if (RECORD_IS_USED)
-       do_cleanups (old_cleanups);
+      do_cleanups (old_cleanups);
     }
 }