aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-07-09 22:42:43 +0000
committerPedro Alves <palves@redhat.com>2008-07-09 22:42:43 +0000
commit94cc34afe2c3d9377f1b9cfd481b5822a03c283f (patch)
treee1b45035ccc11f0da08e382edfcfd6a835154323 /gdb/target.c
parent59f0d5d9531817d3bb09aeef8fd33515b51a7cba (diff)
downloadgdb-94cc34afe2c3d9377f1b9cfd481b5822a03c283f.zip
gdb-94cc34afe2c3d9377f1b9cfd481b5822a03c283f.tar.gz
gdb-94cc34afe2c3d9377f1b9cfd481b5822a03c283f.tar.bz2
Non-stop inferior control.
* infrun.c (resume): In non-stop mode, always resume just one thread. (proceed): Don't call prepare_to_proceed in non-stop mode. (fetch_inferior_event): In non-stop mode, switch context before handling the event. (error_is_running, ensure_not_running): New. (handle_inferior_event): In non-stop mode: Mark only the event thread as stopped. Require that the target module manages adding threads to the thread list. Assert that there isn't a deferred_step_ptid set. Don't switch to infwait_thread_hop_state. (normal_stop): Only mark not-running if inferior hasn't exited. In non-stop mode, only mark the event thread. * thread.c:Include "cli/cli-decode.h". (print_thread_info): Don't read from a running thread. Output "(running)" if thread is running. (switch_to_thread): Don't read stop_pc if thread is executing. (do_restore_current_thread_cleanup): Don't write to a running thread. (thread_apply_all_command): Don't read from a running thread. In non-stop mode, do a full context-switch instead of just switching threads. (thread_apply_command): In non-stop mode, do a full context-switch instead of just switching threads. (do_captured_thread_select): Likewise. Inform user if selected thread is running. (_initialize_thread): Mark "info threads" and "thread" and async_ok. * inf-loop.c (inferior_event_handler): In non-stop mode, don't unregister the target from the event loop. * infcmd.c (continue_command, step_1, jump_command) (signal_command): Ensure the selected thread isn't running. (interrupt_target_command): In non-stop mode, interrupt only the selected thread. * inferior.h (error_is_running, ensure_not_running): Declare. * target.h (struct target_ops): Add ptid argument to the to_stop member. (target_stop): Add ptid_t argument. * target.c (update_current_target): Add ptid argument to to_stop's type. (debug_to_stop): Add ptid_t argument. (debug_to_rcmd): Set to_stop_ptid. * remote.c (remote_stop): Add ptid_t argument. (async_remote_interrupt): Add inferior_ptid to target_stop. * inf-ptrace.c (inf_ptrace_stop): Add ptid argument. * Makefile.in (thread.o): Depend on $(cli_decode_h).
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 6e71080..461cfe3 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -165,7 +165,7 @@ static void debug_to_notice_signals (ptid_t);
static int debug_to_thread_alive (ptid_t);
-static void debug_to_stop (void);
+static void debug_to_stop (ptid_t);
/* NOTE: cagney/2004-09-29: Many targets reference this variable in
wierd and mysterious ways. Putting the variable here lets those
@@ -630,7 +630,7 @@ update_current_target (void)
(char *(*) (struct thread_info *))
return_zero);
de_fault (to_stop,
- (void (*) (void))
+ (void (*) (ptid_t))
target_ignore);
current_target.to_xfer_partial = current_xfer_partial;
de_fault (to_rcmd,
@@ -2997,11 +2997,12 @@ debug_to_find_new_threads (void)
}
static void
-debug_to_stop (void)
+debug_to_stop (ptid_t ptid)
{
- debug_target.to_stop ();
+ debug_target.to_stop (ptid);
- fprintf_unfiltered (gdb_stdlog, "target_stop ()\n");
+ fprintf_unfiltered (gdb_stdlog, "target_stop (%s)\n",
+ target_pid_to_str (ptid));
}
static void