aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-08-16 19:57:19 +0000
committerJason Molenda <jmolenda@apple.com>1999-08-16 19:57:19 +0000
commit7be570e7ce77920e2e628a03bdfe2d295fc2568f (patch)
treea49512270bb021f1d5171b362dc973e28c97ca94 /gdb/testsuite/gdb.base
parented288bb597072176e84fc8279707a3f2f475779b (diff)
downloadgdb-7be570e7ce77920e2e628a03bdfe2d295fc2568f.zip
gdb-7be570e7ce77920e2e628a03bdfe2d295fc2568f.tar.gz
gdb-7be570e7ce77920e2e628a03bdfe2d295fc2568f.tar.bz2
import gdb-1999-08-16 snapshot
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp49
-rw-r--r--gdb/testsuite/gdb.base/maint.exp43
2 files changed, 76 insertions, 16 deletions
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 05f3fe4..092b31a 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -160,7 +160,15 @@ proc dbx_reinitialize_dir { subdir } {
# of this command returns, causing the test to get out of sync and fail
# seemingly randomly or only on a loaded system.
#
-proc dbx_gdb_file_cmd {arg } {
+# Problem is, though, that the testsuite config files can override the definition of
+# gdb_load (without notice, as was mentioned above). Unfortunately, the gdb_load proc
+# that was copied into this test was a copy of the unix native version.
+#
+# The real problem that we're attempting to solve is how to load an exec and symbol
+# 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.
+proc gdb_file_cmd {arg} {
global verbose
global loadpath
global loadfile
@@ -169,6 +177,14 @@ proc dbx_gdb_file_cmd {arg } {
global spawn_id
upvar timeout timeout
+ if [is_remote host] {
+ set arg [remote_download host $arg];
+ if { $arg == "" } {
+ error "download failed"
+ return -1;
+ }
+ }
+
send_gdb "symbol-file $arg\n"
gdb_expect {
-re "Detected 64-bit symbol file.\r\nInvoking.*gdb64.*$gdb_prompt $" {
@@ -245,17 +261,6 @@ proc dbx_gdb_file_cmd {arg } {
}
}
-proc dbx_gdb_load { arg } {
- global verbose
- global loadpath
- global loadfile
- global GDB
- global prompt
- upvar timeout timeout
-
- return [dbx_gdb_file_cmd $arg]
-}
-
#
#test_breakpoints
#
@@ -271,8 +276,22 @@ proc test_breakpoints { } {
#test_assign
#
proc test_assign { } {
- gdb_test "run" ""
- gdb_test "assign first=1" ""
+ global decimal
+ global gdb_prompt
+
+ gdb_run_cmd
+ gdb_expect 30 {
+ -re "Break.* at .*:$decimal.*$gdb_prompt $" { pass "running to main" }
+ -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" { pass "running to main" }
+ -re "$gdb_prompt $" { fail "running to main" }
+ timeout { fail "running to main (timeout)" }
+ }
+ send_gdb "assign first=1\n"
+ gdb_expect {
+ -re "No symbol \"first\" in current context.*$" { fail "assign first" }
+ "$gdb_prompt $" { pass "assign first" }
+ timeout { fail "assign first (timeout)" }
+ }
gdb_test "print first" ".1 = 1"
}
@@ -304,7 +323,7 @@ set saved_gdbflags $GDBFLAGS
set GDBFLAGS "$GDBFLAGS --dbx"
gdb_start
dbx_reinitialize_dir $srcdir/$subdir
-dbx_gdb_load ${binfile}
+gdb_load ${binfile}
test_breakpoints
test_assign
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index b1f7c53..4c64b97 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -31,6 +31,7 @@
#maintenance dump-me -- Get fatal error; make debugger dump its core
#maintenance print -- Maintenance command for printing GDB internal state
#maintenance info -- Commands for showing internal info about the program being debugged
+#maintenance internal-error -- Give GDB an internal error.
#
#maintenance print statistics -- Print statistics about internal gdb state
#maintenance print objfiles -- Print dump of current object file definitions
@@ -442,7 +443,7 @@ set timeout $oldtimeout
send_gdb "help maint\n"
gdb_expect {
- -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
{ pass "help maint" }
-re ".*$gdb_prompt $" { fail "help maint" }
timeout { fail "(timeout) help maint" }
@@ -489,6 +490,14 @@ gdb_expect {
timeout { fail "(timeout) help maint dump-me" }
}
+send_gdb "help maint internal-error\n"
+gdb_expect {
+ -re "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*$gdb_prompt $"\
+ { pass "help maint internal-error" }
+ -re ".*$gdb_prompt $" { fail "help maint internal-error" }
+ timeout { fail "(timeout) help maint internal-error" }
+ }
+
send_gdb "help maint print statistics\n"
gdb_expect {
-re "Print statistics about internal gdb state\\..*$gdb_prompt $"\
@@ -612,6 +621,38 @@ gdb_expect {
timeout { fail "(timeout) maint dump-me" }
}
+send_gdb "maint internal-error\n"
+gdb_expect {
+ -re "Continue this debugging session.*\\(y or n\\) $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Create a core file.*\\(y or n\\) $" {
+ send_gdb "n\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ pass "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+}
+
#set timeout $oldtimeout