aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-09-17 20:41:22 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-09-17 20:41:22 +0000
commit739d0d99b33332323e03c11f9fc03a5c499199c6 (patch)
treeef13c5ac89c234ea7c535c9301f20c3a030e69eb
parent1b8947f0b5670b7f1a3c1305d4115bd7e5a1ab69 (diff)
downloadgdb-739d0d99b33332323e03c11f9fc03a5c499199c6.zip
gdb-739d0d99b33332323e03c11f9fc03a5c499199c6.tar.gz
gdb-739d0d99b33332323e03c11f9fc03a5c499199c6.tar.bz2
* gdb.base/display.c (do_loops): Add float variable `f'.
Increment f in loop. * gdb.base/display.exp: Increment timeout by 60 seconds. Change float display test to use variable `f'.
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/display.c4
-rw-r--r--gdb/testsuite/gdb.base/display.exp20
3 files changed, 24 insertions, 7 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b10aed8..bf5afd1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2001-09-17 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/display.c (do_loops): Add float variable `f'.
+ Increment f in loop.
+ * gdb.base/display.exp: Increment timeout by 60 seconds.
+ Change float display test to use variable `f'.
+
2001-09-17 Jim Blandy <jimb@redhat.com>
* gdb.base/restore.exp: Use temporary breakpoints, to avoid
diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c
index a85f067..3652409 100644
--- a/gdb/testsuite/gdb.base/display.c
+++ b/gdb/testsuite/gdb.base/display.c
@@ -10,11 +10,11 @@ int do_loops()
int i=0;
int k=0;
int j=0;
-
+ float f=3.1415;
for( i = 0; i < LOOP; i++ ) {
for( j = 0; j < LOOP; j++ ) {
for( k = 0; k < LOOP; k++ ) {
- sum++;
+ sum++; f++;
}
}
}
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index 495b170..e285729 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -38,6 +38,11 @@ if [target_info exists gdb_stub] {
gdb_step_for_stub;
}
+# Preserve the old timeout, and set a new one that should be
+# sufficient to avoid timing out during this test.
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+verbose "Timeout is now $timeout seconds" 2
# use this to debug:
#log_user 1
@@ -90,13 +95,13 @@ gdb_test "info disp" ".*There are no auto-display expressions now..*" "inf disp"
gdb_test "disp i" ".*1: i = 0.*" "display i"
gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j"
gdb_test "disp/i &k" ".*3: x/i &k $hex:.*" "display &k"
-gdb_test "disp/f sum" ".*4: /f sum = 0.*" "display/f sum"
+gdb_test "disp/f f" ".*4: /f f = 3.1415*" "display/f f"
gdb_test "disp/s &sum" ".*5: x/s &sum $hex.*sum.:.*" "display/s &sum"
# Hit the displays
#
-gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f sum = 1.40129846e.45\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
-gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f sum = 2.80259693e.45\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
+gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
+gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
gdb_test "enab disp 6" ".*No display number 6..*" "catch err"
gdb_test "disab disp 1" ".*" "disab disp 1"
@@ -104,9 +109,9 @@ gdb_test "disab disp 2" ".*" "disab disp 2"
gdb_test "enab disp 1" ".*" "re-enab"
gdb_test "enab disp 1" ".*" "re-enab of enab"
gdb_test "undisp 5" ".*" "undisp"
-gdb_test "info disp" ".*Auto-display expressions now in effect.*y /f sum.*y /1bi &k.*n /x j.*y i.*" "info disp"
+gdb_test "info disp" ".*Auto-display expressions now in effect.*y /f f.*y /1bi &k.*n /x j.*y i.*" "info disp"
-gdb_test "cont" ".*\[Ww\]atch.*4.20389539e-45.*.*i = 0.*" "next hit"
+gdb_test "cont" ".*\[Ww\]atch.*5.1415.*.*i = 0.*" "next hit"
send_gdb "undisp\n"
gdb_expect {
@@ -202,4 +207,9 @@ gdb_test "print/a &&j" ".*A .* error in expression.*"
# Done!
#
gdb_exit
+
+# Restore the preserved old timeout value.
+set timeout $oldtimeout
+verbose "Timeout is now $timeout seconds" 2
+
return 0