aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-09-08 22:10:20 +0000
committerPedro Alves <palves@redhat.com>2008-09-08 22:10:20 +0000
commitdcf4fbde10e63c5cc5fa08b7280b751d01a8efaf (patch)
tree9e2e0a6deddd136c579e025c17d96828aa1f9946 /gdb/infrun.c
parentfedae5ffbcc3c8ddd072ad61334f710f940a4a4a (diff)
downloadgdb-dcf4fbde10e63c5cc5fa08b7280b751d01a8efaf.zip
gdb-dcf4fbde10e63c5cc5fa08b7280b751d01a8efaf.tar.gz
gdb-dcf4fbde10e63c5cc5fa08b7280b751d01a8efaf.tar.bz2
* inferior.h (context_switch_to): Delete.
* infrun.c (context_switch): Don't save and load infrun state. (context_switch_to): Delete. * infcmd.c (proceed_thread_callback): Replace context_switch_to calls by switch_to_thread calls. * gdbthread.h (save_infrun_state, load_infrun_state): Delete. * thread.c (main_thread_state, main_thread_executing): Delete. (inferior_thread): Delete references to them. (add_thread_silent): Fix case where we're adding a thread with the same ptid as an exited thread. Remove references to context-switching. (load_infrun_state, save_infrun_state): Delete. (thread_alive, is_thread_state, any_running, is_executing) (set_executing): Remove the special handling for targets that don't register any thread. (restore_current_thread, thread_apply_all_command) (do_captured_thread_select): Unconditionally call switch_to_thread. * mi/mi-main.c (mi_cmd_execute): Check for exited threads. Call switch_to_thread instead of context_switch_to.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 09afaa8..ede6309 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1720,17 +1720,11 @@ nullify_last_target_wait_ptid (void)
target_last_wait_ptid = minus_one_ptid;
}
-/* Switch thread contexts, maintaining "infrun state". */
+/* Switch thread contexts. */
static void
context_switch (ptid_t ptid)
{
- /* Caution: it may happen that the new thread (or the old one!)
- is not in the thread list. In this case we must not attempt
- to "switch context", or we run the risk that our context may
- be lost. This may happen as a result of the target module
- mishandling thread creation. */
-
if (debug_infrun)
{
fprintf_unfiltered (gdb_stdlog, "infrun: Switching context from %s ",
@@ -1739,32 +1733,9 @@ context_switch (ptid_t ptid)
target_pid_to_str (ptid));
}
- if (in_thread_list (inferior_ptid) && in_thread_list (ptid))
- { /* Perform infrun state context switch: */
- /* Save infrun state for the old thread. */
- save_infrun_state (inferior_ptid);
-
- /* Load infrun state for the new thread. */
- load_infrun_state (ptid);
- }
-
switch_to_thread (ptid);
}
-/* Context switch to thread PTID. */
-ptid_t
-context_switch_to (ptid_t ptid)
-{
- ptid_t current_ptid = inferior_ptid;
-
- /* Context switch to the new thread. */
- if (!ptid_equal (ptid, inferior_ptid))
- {
- context_switch (ptid);
- }
- return current_ptid;
-}
-
static void
adjust_pc_after_break (struct execution_control_state *ecs)
{