• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision4c42eaff630026a1c9589e913d072935fed919c1 (tree)
Time2006-07-25 05:38:08
AuthorDaniel Jacobowitz <drow@fals...>
CommiterDaniel Jacobowitz

Log Message

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.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
211
312 * regcache.c (struct regcache): Make register_valid_p a signed char
413 array.
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -156,8 +156,8 @@ reopen_exec_file (void)
156156 struct stat st;
157157 long mtime;
158158
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)
161161 return;
162162
163163 /* If the timestamp of the exec file has changed, reopen it. */
@@ -167,9 +167,7 @@ reopen_exec_file (void)
167167 res = stat (filename, &st);
168168
169169 if (mtime && mtime != st.st_mtime)
170- {
171- exec_open (filename, 0);
172- }
170+ exec_file_attach (filename, 0);
173171 #endif
174172 }
175173
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -85,7 +85,7 @@ show_write_files (struct ui_file *file, int from_tty,
8585
8686 struct vmap *vmap;
8787
88-void
88+static void
8989 exec_open (char *args, int from_tty)
9090 {
9191 target_preopen (from_tty);
@@ -286,8 +286,11 @@ exec_file_command (char *args, int from_tty)
286286 {
287287 char **argv;
288288 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."));
291294
292295 if (args)
293296 {
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -123,8 +123,6 @@ extern int write_files;
123123
124124 extern void core_file_command (char *filename, int from_tty);
125125
126-extern void exec_open (char *filename, int from_tty);
127-
128126 extern void exec_file_attach (char *filename, int from_tty);
129127
130128 extern void exec_file_clear (int from_tty);
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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+
18 2006-07-24 Nathan Sidwell <nathan@codesourcery.com>
29
310 * gdb.base/auxv.exp: Skip on non-linux, non-solaris targets.
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -671,19 +671,14 @@ sleep 1
671671 gdb_expect {
672672 -re "^file ./gdb.base/completion\\.exp $"\
673673 { 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+ }
687682 }
688683 -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/complet'" }
689684 timeout { fail "(timeout) complete 'file ./gdb.base/complet'" }
--- a/gdb/testsuite/gdb.stabs/weird.exp
+++ b/gdb/testsuite/gdb.stabs/weird.exp
@@ -313,7 +313,7 @@ gdb_expect 60 {
313313 -re "^file (\[^ \]| +\008)*\r*\n" {
314314 exp_continue
315315 }
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\\)" {
317317 send_gdb "y\n"
318318 exp_continue
319319 }
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1008,6 +1008,20 @@ proc gdb_file_cmd { arg } {
10081008 }
10091009 }
10101010
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+
10111025 send_gdb "file $arg\n"
10121026 gdb_expect 120 {
10131027 -re "Reading symbols from.*no debugging symbols found.*done.*$gdb_prompt $" {
@@ -1020,11 +1034,6 @@ proc gdb_file_cmd { arg } {
10201034 set gdb_file_cmd_debug_info "debug"
10211035 return 0
10221036 }
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- }
10281037 -re "Load new symbol table from \".*\".*y or n. $" {
10291038 send_gdb "y\n"
10301039 gdb_expect 120 {
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -411,11 +411,6 @@ proc mi_gdb_file_cmd { arg } {
411411 perror "$arg wasn't compiled with \"-g\""
412412 return -1
413413 }
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- }
419414 -re "Load new symbol table from \".*\".*y or n. $" {
420415 send_gdb "y\n"
421416 gdb_expect 120 {