* infrun.c (stepping_past_breakpoint): New global variable.

(stepping_past_breakpoint_ptid): Likewise.
	(prepare_to_proceed): Add STEP parameter.  Do not check for Ctrl-C.
	Only switch threads if we need to single-step over a breakpoint hit
	in the previously selected thread.  If stepping, remember previous
	thread to switch back to in STEPPING_PAST_BREAKPOINT[_PTID].  Call
	switch_to_thread instead of copying its contents.
	(proceed): Pass STEP to prepare_to_proceed.  Always set ONEPROC if
	prepare_to_proceed returns true.
	(init_wait_for_inferior): Reset STEPPING_PAST_BREAKPOINT.
	(context_switch): Call switch_to_thread.
	(handle_inferior_event): Switch back to previous thread if requested
	in STEPPING_PAST_BREAKPOINT[_PTID] by prepare_to_proceed.
	* gdbthread.h (switch_to_thread): Add prototype.
	* thread.c (switch_to_thread): Make global.
This commit is contained in:
Ulrich Weigand
2007-09-10 18:49:26 +00:00
parent 548061812a
commit 6a6b96b9c2
4 changed files with 79 additions and 29 deletions

View File

@@ -135,6 +135,9 @@ extern void load_infrun_state (ptid_t ptid,
int *current_line,
struct symtab **current_symtab);
/* Switch from one thread to another. */
extern void switch_to_thread (ptid_t ptid);
/* Commands with a prefix of `thread'. */
extern struct cmd_list_element *thread_cmd_list;