summaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-07-09 22:16:15 +0000
committerPedro Alves <pedro@codesourcery.com>2008-07-09 22:16:15 +0000
commitd065f280b0e34d3e76f483f1c8eb50dcb491eab9 (patch)
tree36f31c3a12e0059770381f206d62d17f637e9689 /gdb/event-top.c
parent37f7f50449affa0e4d50deb20b422d98491ee664 (diff)
downloadgdb-d065f280b0e34d3e76f483f1c8eb50dcb491eab9.tar.gz
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).
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index e8e9f68bb9a..681dca8a64d 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -32,6 +32,7 @@
#include "exceptions.h"
#include "cli/cli-script.h" /* for reset_command_nest_depth */
#include "main.h"
+#include "gdbthread.h"
/* For dont_repeat() */
#include "gdbcmd.h"
@@ -268,7 +269,7 @@ display_gdb_prompt (char *new_prompt)
if (!current_interp_display_prompt_p ())
return;
- if (target_executing && sync_execution)
+ if (sync_execution && is_running (inferior_ptid))
{
/* This is to trick readline into not trying to display the
prompt. Even though we display the prompt using this
@@ -516,7 +517,7 @@ command_handler (char *command)
/* Do any commands attached to breakpoint we stopped at. Only if we
are always running synchronously. Or if we have just executed a
command that doesn't start the target. */
- if (!target_can_async_p () || !target_executing)
+ if (!target_can_async_p () || !is_running (inferior_ptid))
{
bpstat_do_actions (&stop_bpstat);
do_cleanups (old_chain);