From 8ea051c51f64f1f720b12a7424c56ac31ff9a58b Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 9 Jul 2008 22:16:15 +0000 Subject: Add "executing" property to threads. * inferior.h (target_executing): Delete. * gdbthread.h (struct thread_info): Add executing_ field. (set_executing, is_executing): New. * thread.c (main_thread_executing): New. (init_thread_list): Clear it and also main_thread_running. (is_running): Return false if target has no execution. (any_running, is_executing, set_executing): New. * top.c: Include "gdbthread.h". (target_executing): Delete. (execute_command): Replace target_executing check by any_running. * event-top.c: Include "gdbthread.h". (display_gdb_prompt, command_handler): Replace target_executing by is_running. * inf-loop.c: Include "gdbthread.h". Don't mark as not executing here. Replace target_executing by is_running. * infrun.c (handle_inferior_event): Mark all threads as not-executing. * linux-nat.c (linux_nat_resume): Don't mark thread as executing here. * stack.c (get_selected_block): Return null if inferior is executing. * target.c (target_resume): Mark resumed ptid as executing. * breakpoint.c (until_break_command): Replace target_executing check by is_executing. * remote.c (remote_async_resume): Don't mark inferior as executing here. * mi/mi-interp.c (mi_cmd_interpreter_exec): Replace target_executing by any_running. * mi/mi-main.c (mi_cmd_exec_interrupt, mi_cmd_execute) (mi_execute_async_cli_command): Replace target_executing by is_running. * frame.c (get_current_frame): Error out if the current thread is executing. (has_stack_frames): New. (get_selected_frame, deprecated_safe_get_selected_frame): Check has_stack_frames. * Makefile.in (event-top.o, frame.o, inf-loop.o, top.o): Depend on $(gdbthread_h). --- gdb/inf-loop.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'gdb/inf-loop.c') diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index f77bc65..3f98bfc 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -26,6 +26,7 @@ #include "remote.h" #include "exceptions.h" #include "language.h" +#include "gdbthread.h" static int fetch_inferior_event_wrapper (gdb_client_data client_data); @@ -72,14 +73,6 @@ inferior_event_handler (enum inferior_event_type event_type, break; case INF_EXEC_COMPLETE: - - /* This is the first thing to do -- so that continuations know that - the target is stopped. For example, command_line_handler_continuation - will run breakpoint commands, and if we think that the target is - running, we'll refuse to execute most commands. MI continuation - presently uses target_executing to either print or not print *stopped. */ - target_executing = 0; - /* Unregister the inferior from the event loop. This is done so that when the inferior is not running we don't get distracted by spurious inferior output. */ @@ -121,8 +114,8 @@ inferior_event_handler (enum inferior_event_type event_type, /* If no breakpoint command resumed the inferior, prepare for interaction with the user. */ - if (!target_executing) - { + if (!is_running (inferior_ptid)) + { if (was_sync) { display_gdb_prompt (0); -- cgit v1.1