summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-03-25 21:42:34 +0000
committerPedro Alves <pedro@codesourcery.com>2009-03-25 21:42:34 +0000
commit697b6e50ee00d29a2e2a9006bffef55c90a700f9 (patch)
treed7041d724d807cfe6fc9dfa51f43ae4a311be1e2 /gdb/top.c
parentc98e800a85b9485019404fadac21abe3491b5033 (diff)
downloadgdb-697b6e50ee00d29a2e2a9006bffef55c90a700f9.tar.gz
* infrun.c (normal_stop): Use has_stack_frames instead of
target_has_stack. * mi/mi-main.c (mi_execute_command): Avoid calling inferior_thread when there is no thread selected. (mi_cmd_execute): Don't special case commands that can run without a valid selected thread. * top.c (execute_command): Don't special case commands that can run without a valid selected thread. Use has_stack_frames. * infcmd.c (ensure_valid_thread): New. (continue_1, step_1, jump_command, signal_command): Use it. (detach_command): Error out if there's no selected thread/inferior. * thread.c (print_thread_info): Allow having no thread selected. (switch_to_thread): Don't read the PC if there is no current thread. (do_restore_current_thread_cleanup): Don't record the current frame if there is no current thread. (make_cleanup_restore_current_thread): Don't read frame info if there is no selected thread. (_initialize_thread): Don't mark commands as "no_selected_thread_ok". * frame.c (get_current_frame): Error out if there is no valid selected thread. (has_stack_frames): Return false if there is no valid selected thread. * cli/cli-cmds.c (init_cli_cmds): Don't mark commands as "no_selected_thread_ok". * cli/cli-decode.c (set_cmd_no_selected_thread_ok) (get_cmd_no_selected_thread_ok): Delete. * cli/cli-decode.h (CMD_NO_SELECTED_THREAD_OK): Delete. (set_cmd_no_selected_thread_ok, get_cmd_no_selected_thread_ok): Delete declaration. * stack.c (get_selected_block): Use has_stack_frames.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 0ee3df12b81..3aff25f98b9 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -400,14 +400,6 @@ execute_command (char *p, int from_tty)
c = lookup_cmd (&p, cmdlist, "", 0, 1);
- /* If the selected thread has terminated, we allow only a
- limited set of commands. */
- if (target_can_async_p ()
- && is_exited (inferior_ptid)
- && !get_cmd_no_selected_thread_ok (c))
- error (_("\
-Cannot execute this command without a live selected thread. See `help thread'."));
-
/* Pass null arg rather than an empty one. */
arg = *p ? p : 0;
@@ -469,7 +461,7 @@ Cannot execute this command without a live selected thread. See `help thread'."
/* FIXME: This should be cacheing the frame and only running when
the frame changes. */
- if (target_has_stack && is_stopped (inferior_ptid))
+ if (has_stack_frames ())
{
flang = get_frame_language ();
if (!warned