aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-03-30 23:47:18 +0000
committerDaniel Jacobowitz <drow@false.org>2002-03-30 23:47:18 +0000
commit1e50cda1d1dcced52bba66fbb9343b05a9d65666 (patch)
tree448f4bc009f935c374f20c0b3d190e2b649a1ecb /gdb/testsuite
parent24015922ffbd541dfb49ea2e60bdae8b3d84b371 (diff)
downloadgdb-1e50cda1d1dcced52bba66fbb9343b05a9d65666.zip
gdb-1e50cda1d1dcced52bba66fbb9343b05a9d65666.tar.gz
gdb-1e50cda1d1dcced52bba66fbb9343b05a9d65666.tar.bz2
2002-03-30 Daniel Jacobowitz <drow@mvista.com>
Fix PR gdb/452 * gdb.base/dbx.exp: Restore old definition of gdb_file_cmd when finished. Make gdb_file_cmd send "exec-file" when appropriate.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp28
2 files changed, 20 insertions, 15 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b845c07..5af739d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2002-03-30 Daniel Jacobowitz <drow@mvista.com>
+ Fix PR gdb/452
+ * gdb.base/dbx.exp: Restore old definition of gdb_file_cmd
+ when finished. Make gdb_file_cmd send "exec-file" when
+ appropriate.
+
+2002-03-30 Daniel Jacobowitz <drow@mvista.com>
+
* gdb.base/attach.exp: Remove extra setup_xfail.
2002-03-26 Michael Snyder <msnyder@redhat.com>
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 9df3bda..161333c 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -168,6 +168,11 @@ proc dbx_reinitialize_dir { subdir } {
# file into gdb for a dbx session. So why not just override gdb_file_cmd with the
# right sequence of events, allowing gdb_load to do its normal thing? This way
# remotes and simulators will work, too.
+#
+# [drow 2002-03-30]: We can restore the old gdb_file_cmd afterwards, though.
+set old_gdb_file_cmd_args [info args gdb_file_cmd]
+set old_gdb_file_cmd_body [info body gdb_file_cmd]
+
proc gdb_file_cmd {arg} {
global verbose
global loadpath
@@ -206,6 +211,11 @@ proc gdb_file_cmd {arg} {
verbose "\t\tLoaded $arg into the $GDB"
send_gdb "exec-file $arg\n"
gdb_expect {
+ -re "A program is being debugged already.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
-re ".*$gdb_prompt $" {
verbose "\t\tLoaded $arg with new symbol table into $GDB"
return 0
@@ -221,23 +231,9 @@ proc gdb_file_cmd {arg} {
perror "$arg wasn't compiled with \"-g\""
return -1
}
- -re "A program is being debugged already.*Kill it.*y or n. $" {
- send_gdb "y\n"
- verbose "\t\tKilling previous program being debugged"
- exp_continue
- }
-re "Load new symbol table from \".*\".*y or n. $" {
send_gdb "y\n"
- gdb_expect {
- -re "Reading symbols from.*done.*$gdb_prompt $" {
- verbose "\t\tLoaded $arg with new symbol table into $GDB"
- return 0
- }
- timeout {
- perror "(timeout) Couldn't load $arg, other program already loaded."
- return -1
- }
- }
+ exp_continue
}
-re ".*No such file or directory.*$gdb_prompt $" {
perror "($arg) No such file or directory\n"
@@ -339,4 +335,6 @@ test_func
gdb_exit
set GDBFLAGS $saved_gdbflags
+eval proc gdb_file_cmd {$old_gdb_file_cmd_args} {$old_gdb_file_cmd_body}
+
return 0