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.
This commit is contained in:
Ulrich Weigand
2010-06-23 12:46:37 +00:00
parent 61e8a5ea17
commit d03285ec7b
9 changed files with 315 additions and 0 deletions

View File

@ -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. */