GNU Binutils with patches for OS216
Revision | 4c42eaff630026a1c9589e913d072935fed919c1 (tree) |
---|---|
Zeit | 2006-07-25 05:38:08 |
Autor | Daniel Jacobowitz <drow@fals...> |
Commiter | Daniel Jacobowitz |
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.
@@ -1,4 +1,13 @@ | ||
1 | -2006-07-21 Frederic Riss <frederic.riss@st.com> | |
1 | +2006-07-24 Daniel Jacobowitz <dan@codesourcery.com> | |
2 | + | |
3 | + * corefile.c (reopen_exec_file): Only check for an open exec file. | |
4 | + Use exec_file_attach. | |
5 | + * exec.c (exec_open): Make static. | |
6 | + (exec_file_command): Don't use target_preopen. Query directly about | |
7 | + changing the file. | |
8 | + * gdbcore.h (exec_open): Remove prototype. | |
9 | + | |
10 | +2006-07-24 Frederic Riss <frederic.riss@st.com> | |
2 | 11 | |
3 | 12 | * regcache.c (struct regcache): Make register_valid_p a signed char |
4 | 13 | array. |
@@ -156,8 +156,8 @@ reopen_exec_file (void) | ||
156 | 156 | struct stat st; |
157 | 157 | long mtime; |
158 | 158 | |
159 | - /* Don't do anything if the current target isn't exec. */ | |
160 | - if (exec_bfd == NULL || strcmp (target_shortname, "exec") != 0) | |
159 | + /* Don't do anything if there isn't an exec file. */ | |
160 | + if (exec_bfd == NULL) | |
161 | 161 | return; |
162 | 162 | |
163 | 163 | /* If the timestamp of the exec file has changed, reopen it. */ |
@@ -167,9 +167,7 @@ reopen_exec_file (void) | ||
167 | 167 | res = stat (filename, &st); |
168 | 168 | |
169 | 169 | if (mtime && mtime != st.st_mtime) |
170 | - { | |
171 | - exec_open (filename, 0); | |
172 | - } | |
170 | + exec_file_attach (filename, 0); | |
173 | 171 | #endif |
174 | 172 | } |
175 | 173 |
@@ -85,7 +85,7 @@ show_write_files (struct ui_file *file, int from_tty, | ||
85 | 85 | |
86 | 86 | struct vmap *vmap; |
87 | 87 | |
88 | -void | |
88 | +static void | |
89 | 89 | exec_open (char *args, int from_tty) |
90 | 90 | { |
91 | 91 | target_preopen (from_tty); |
@@ -286,8 +286,11 @@ exec_file_command (char *args, int from_tty) | ||
286 | 286 | { |
287 | 287 | char **argv; |
288 | 288 | char *filename; |
289 | - | |
290 | - target_preopen (from_tty); | |
289 | + | |
290 | + if (from_tty && target_has_execution | |
291 | + && !query (_("A program is being debugged already.\n" | |
292 | + "Are you sure you want to change the file? "))) | |
293 | + error (_("File not changed.")); | |
291 | 294 | |
292 | 295 | if (args) |
293 | 296 | { |
@@ -123,8 +123,6 @@ extern int write_files; | ||
123 | 123 | |
124 | 124 | extern void core_file_command (char *filename, int from_tty); |
125 | 125 | |
126 | -extern void exec_open (char *filename, int from_tty); | |
127 | - | |
128 | 126 | extern void exec_file_attach (char *filename, int from_tty); |
129 | 127 | |
130 | 128 | extern void exec_file_clear (int from_tty); |
@@ -1,3 +1,10 @@ | ||
1 | +2006-07-24 Daniel Jacobowitz <dan@codesourcery.com> | |
2 | + | |
3 | + * gdb.base/completion.exp: Update for change in "file" behavior. | |
4 | + * gdb.stabs/weird.exp: Likewise. | |
5 | + * lib/mi-support.exp (mi_gdb_file_cmd): Likewise. | |
6 | + * lib/gdb.exp (gdb_file_cmd): Likewise. Kill the program explicitly. | |
7 | + | |
1 | 8 | 2006-07-24 Nathan Sidwell <nathan@codesourcery.com> |
2 | 9 | |
3 | 10 | * gdb.base/auxv.exp: Skip on non-linux, non-solaris targets. |
@@ -671,19 +671,14 @@ sleep 1 | ||
671 | 671 | gdb_expect { |
672 | 672 | -re "^file ./gdb.base/completion\\.exp $"\ |
673 | 673 | { send_gdb "\n" |
674 | - gdb_expect { | |
675 | - -re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $" | |
676 | - { send_gdb "n\n" | |
677 | - gdb_expect { | |
678 | - -re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\ | |
679 | - { pass "complete 'file ./gdb.base/complet'"} | |
680 | - -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/complet'"} | |
681 | - timeout {fail "(timeout) complete 'file ./gdb.base/complet'"} | |
682 | - } | |
683 | - } | |
684 | - -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/complet'"} | |
685 | - timeout {fail "(timeout) complete 'file ./gdb.base/complet'"} | |
686 | - } | |
674 | + # Ignore the exact error message. | |
675 | + gdb_test_multiple "" "complete 'file ./gdb.base/complet'" { | |
676 | + -re "\r\nA program is being debugged already\\.\[\r\n\]+Are you sure you want to change the file\\? \\(y or n\\) $" { | |
677 | + send_gdb "n\n" | |
678 | + exp_continue | |
679 | + } | |
680 | + -re ".*$gdb_prompt $" { pass "complete 'file ./gdb.base/complet'" } | |
681 | + } | |
687 | 682 | } |
688 | 683 | -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/complet'" } |
689 | 684 | timeout { fail "(timeout) complete 'file ./gdb.base/complet'" } |
@@ -313,7 +313,7 @@ gdb_expect 60 { | ||
313 | 313 | -re "^file (\[^ \]| +\008)*\r*\n" { |
314 | 314 | exp_continue |
315 | 315 | } |
316 | - -re "A program is being debugged already. Kill it\\? \\(y or n\\)" { | |
316 | + -re "A program is being debugged already.\[\r\n\]+Are you sure you want to change the file\\? \\(y or n\\)" { | |
317 | 317 | send_gdb "y\n" |
318 | 318 | exp_continue |
319 | 319 | } |
@@ -1008,6 +1008,20 @@ proc gdb_file_cmd { arg } { | ||
1008 | 1008 | } |
1009 | 1009 | } |
1010 | 1010 | |
1011 | + # The file command used to kill the remote target. For the benefit | |
1012 | + # of the testsuite, preserve this behavior. | |
1013 | + send_gdb "kill\n" | |
1014 | + gdb_expect 120 { | |
1015 | + -re "Kill the program being debugged. .y or n. $" { | |
1016 | + send_gdb "y\n" | |
1017 | + verbose "\t\tKilling previous program being debugged" | |
1018 | + exp_continue | |
1019 | + } | |
1020 | + -re "$gdb_prompt $" { | |
1021 | + # OK. | |
1022 | + } | |
1023 | + } | |
1024 | + | |
1011 | 1025 | send_gdb "file $arg\n" |
1012 | 1026 | gdb_expect 120 { |
1013 | 1027 | -re "Reading symbols from.*no debugging symbols found.*done.*$gdb_prompt $" { |
@@ -1020,11 +1034,6 @@ proc gdb_file_cmd { arg } { | ||
1020 | 1034 | set gdb_file_cmd_debug_info "debug" |
1021 | 1035 | return 0 |
1022 | 1036 | } |
1023 | - -re "A program is being debugged already.*Kill it.*y or n. $" { | |
1024 | - send_gdb "y\n" | |
1025 | - verbose "\t\tKilling previous program being debugged" | |
1026 | - exp_continue | |
1027 | - } | |
1028 | 1037 | -re "Load new symbol table from \".*\".*y or n. $" { |
1029 | 1038 | send_gdb "y\n" |
1030 | 1039 | gdb_expect 120 { |
@@ -411,11 +411,6 @@ proc mi_gdb_file_cmd { arg } { | ||
411 | 411 | perror "$arg wasn't compiled with \"-g\"" |
412 | 412 | return -1 |
413 | 413 | } |
414 | - -re "A program is being debugged already.*Kill it.*y or n. $" { | |
415 | - send_gdb "y\n" | |
416 | - verbose "\t\tKilling previous program being debugged" | |
417 | - exp_continue | |
418 | - } | |
419 | 414 | -re "Load new symbol table from \".*\".*y or n. $" { |
420 | 415 | send_gdb "y\n" |
421 | 416 | gdb_expect 120 { |