diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-02-28 16:26:18 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-02-28 16:26:18 +0000 |
commit | 8edfe2693228f91b78661dc04e8c91095ab19487 (patch) | |
tree | eedbb500de71648048b63f651ab5b3b13aeb07d4 /gdb/infcmd.c | |
parent | 0d6ba1b16e08532da8a7fa2de4d867927cf3f9f6 (diff) | |
download | gdb-8edfe2693228f91b78661dc04e8c91095ab19487.zip gdb-8edfe2693228f91b78661dc04e8c91095ab19487.tar.gz gdb-8edfe2693228f91b78661dc04e8c91095ab19487.tar.bz2 |
* infcmd.c (kill_if_already_running): Make static. Use
target_require_runnable.
* target.c (target_require_runnable): New.
* target.h (target_require_runnable): Declare.
* gdb.texinfo (Starting): Mention always-running targets.
(Target Commands): Add an anchor for load.
(Connecting): Explain continue instead of run.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 972f9e2..9d889b2 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -444,11 +444,15 @@ post_create_inferior (struct target_ops *target, int from_tty) from the beginning. Ask the user to confirm that he wants to restart the program being debugged when FROM_TTY is non-null. */ -void +static void kill_if_already_running (int from_tty) { if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution) { + /* Bail out before killing the program if we will not be able to + restart it. */ + target_require_runnable (); + if (from_tty && !query ("The program being debugged has been started already.\n\ Start it from the beginning? ")) |