This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] TARGET_WAITKIND_NO_HISTORY: Pull single step breakpoints out of the target.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 18 Jul 2012 19:06:06 +0100
- Subject: [PATCH] TARGET_WAITKIND_NO_HISTORY: Pull single step breakpoints out of the target.
Running the gdb.reverse/ directory against my x86 software single-step
patches reveals that when the target is (software) single-stepped, and
the target reports that there is no more history, we leave the sss
breakpoints behind. This leads to a bunch of tests tripping on:
../../src/gdb/breakpoint.c:14783: internal-error: insert_single_step_breakpoint: Assertion `single_step_breakpoints[1] == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
when they go about installing sss breakpoints on next resume.
This fixes it. Tested on x86_64 Fedora 17, {hardware/software} single-step.
Applied.
2012-07-18 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_NO_HISTORY>:
Pull the single step breakpoints out of the target.
---
gdb/infrun.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index bd209f7..49a442c 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3669,6 +3669,15 @@ handle_inferior_event (struct execution_control_state *ecs)
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_NO_HISTORY\n");
/* Reverse execution: target ran out of history info. */
+
+ /* Pull the single step breakpoints out of the target. */
+ if (singlestep_breakpoints_inserted_p)
+ {
+ if (!ptid_equal (ecs->ptid, inferior_ptid))
+ context_switch (ecs->ptid);
+ remove_single_step_breakpoints ();
+ singlestep_breakpoints_inserted_p = 0;
+ }
stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));
print_no_history_reason ();
stop_stepping (ecs);