aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2010-06-23 12:46:37 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2010-06-23 12:46:37 +0000
commitd03285ec7b543bb910328d0cc55ff094486ea126 (patch)
treeb15447c5b4fa2424ac99931ac4a08317393078d0 /gdb/infrun.c
parent61e8a5ea173059baf957e65885fbaa3613cc6076 (diff)
downloadgdb-d03285ec7b543bb910328d0cc55ff094486ea126.zip
gdb-d03285ec7b543bb910328d0cc55ff094486ea126.tar.gz
gdb-d03285ec7b543bb910328d0cc55ff094486ea126.tar.bz2
ChangeLog:
* infrun.c (handle_inferior_event): Handle presence of single-step breakpoints for TARGET_WAITKIND_FORKED and TARGET_WAITKIND_VFORKED. Cancel single-step breakpoints for TARGET_WAITKIND_EXITED, TARGET_WAITKIND_SIGNALED, and TARGET_WAITKIND_EXECD. * breakpoint.c (detach_single_step_breakpoints): New function. (detach_breakpoints): Call it. (cancel_single_step_breakpoints): New function. * breakpoint.h (cancel_single_step_breakpoints): Add prototype. * spu-tdep.c (spu_memory_remove_breakpoint): New function. (spu_gdbarch_init): Install it. testsuite/ChangeLog: * gdb.cell/fork.exp: New file. * gdb.cell/fork.c: Likewise. * gdb.cell/fork-spu.c: Likewise.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index f4a5628..351e1a9 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3165,6 +3165,7 @@ handle_inferior_event (struct execution_control_state *ecs)
gdb_flush (gdb_stdout);
target_mourn_inferior ();
singlestep_breakpoints_inserted_p = 0;
+ cancel_single_step_breakpoints ();
stop_print_frame = 0;
stop_stepping (ecs);
return;
@@ -3188,6 +3189,7 @@ handle_inferior_event (struct execution_control_state *ecs)
print_stop_reason (SIGNAL_EXITED, ecs->ws.value.sig);
singlestep_breakpoints_inserted_p = 0;
+ cancel_single_step_breakpoints ();
stop_stepping (ecs);
return;
@@ -3225,6 +3227,13 @@ handle_inferior_event (struct execution_control_state *ecs)
detach_breakpoints (child_pid);
}
+ if (singlestep_breakpoints_inserted_p)
+ {
+ /* Pull the single step breakpoints out of the target. */
+ remove_single_step_breakpoints ();
+ singlestep_breakpoints_inserted_p = 0;
+ }
+
/* In case the event is caught by a catchpoint, remember that
the event is to be followed at the next resume of the thread,
and not immediately. */
@@ -3314,6 +3323,9 @@ handle_inferior_event (struct execution_control_state *ecs)
reinit_frame_cache ();
}
+ singlestep_breakpoints_inserted_p = 0;
+ cancel_single_step_breakpoints ();
+
stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));
/* Do whatever is necessary to the parent branch of the vfork. */