This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 38/40] some fixes to infrun.c
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 17 May 2013 10:21:29 -0600
- Subject: Re: [PATCH 38/40] some fixes to infrun.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com> <72b491c4ccd7996cf471b85b346616f207e69760 dot 1368124285 dot git dot tromey at redhat dot com>
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> This fixes some of the problems in infrun.c that the checker reported.
Tom> I filed the remaining problems as bugs.
The new checker let me drop a couple of parts from this patch.
The new patch is appended.
Tom
* infrun.c (adjust_pc_after_break): Introduce an outer null
cleanup.
---
gdb/infrun.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 54e92f2..b768ffd 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3004,10 +3004,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
@@ -3033,8 +3033,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);
}
}
--
1.8.1.4