aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 7bd2ccd..9653c24 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -85,7 +85,7 @@ show_write_files (struct ui_file *file, int from_tty,
struct vmap *vmap;
-void
+static void
exec_open (char *args, int from_tty)
{
target_preopen (from_tty);
@@ -286,8 +286,11 @@ exec_file_command (char *args, int from_tty)
{
char **argv;
char *filename;
-
- target_preopen (from_tty);
+
+ if (from_tty && target_has_execution
+ && !query (_("A program is being debugged already.\n"
+ "Are you sure you want to change the file? ")))
+ error (_("File not changed."));
if (args)
{