aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-07-24 20:38:08 +0000
committerDaniel Jacobowitz <drow@false.org>2006-07-24 20:38:08 +0000
commit4c42eaff630026a1c9589e913d072935fed919c1 (patch)
treeaf7754be431bda48c2d576f4ebf431a1af11c819 /gdb/exec.c
parentb05e64e5fe26950eba7f895b31019b8cc598b42d (diff)
downloadgdb-4c42eaff630026a1c9589e913d072935fed919c1.zip
gdb-4c42eaff630026a1c9589e913d072935fed919c1.tar.gz
gdb-4c42eaff630026a1c9589e913d072935fed919c1.tar.bz2
gdb/
* corefile.c (reopen_exec_file): Only check for an open exec file. Use exec_file_attach. * exec.c (exec_open): Make static. (exec_file_command): Don't use target_preopen. Query directly about changing the file. * gdbcore.h (exec_open): Remove prototype. gdb/testsuite/ * gdb.base/completion.exp: Update for change in "file" behavior. * gdb.stabs/weird.exp: Likewise. * lib/mi-support.exp (mi_gdb_file_cmd): Likewise. * lib/gdb.exp (gdb_file_cmd): Likewise. Kill the program explicitly.
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)
{