diff mbox

[2/3] gdb: Set max-value-size before running tests.

Message ID cbc0c85480fe3181375268562f5b6f76180e6d5d.1449869723.git.andrew.burgess@embecosm.com
State New
Headers show

Commit Message

Andrew Burgess Dec. 11, 2015, 9:38 p.m. UTC
Setting the max-value-size before running any tests should prevent any
issues where a failing test causes gdb to bring down the testing
machine.

The maximum size is set to 1G, this is large enough to handle all the
well behaving tests, and should make no difference to the test results.

There is one test, gdb.mi/mi-vla-fortran.exp that contains undefined
behaviour, one some machines this test is known to trigger the
max-value-size error.  However, on those machines the test would have
failed anyway, so this commit does not change the PASS / FAIL nature of
the test.  A later commit should modify the mi-vla-fortran.exp test to
expect the failure case.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (default_gdb_start): Set max-value-size.
	* lib/mi-support.exp (default_mi_gdb_start): Likewise.
	* gdb.base/max-value-size.exp: Don't check the initial value.
---
 gdb/testsuite/ChangeLog                   |  6 ++++++
 gdb/testsuite/gdb.base/max-value-size.exp |  8 +++-----
 gdb/testsuite/lib/gdb.exp                 | 10 ++++++++++
 gdb/testsuite/lib/mi-support.exp          | 10 ++++++++++
 4 files changed, 29 insertions(+), 5 deletions(-)

Comments

Joel Brobecker Jan. 1, 2016, 9:48 a.m. UTC | #1
> Setting the max-value-size before running any tests should prevent any
> issues where a failing test causes gdb to bring down the testing
> machine.
> 
> The maximum size is set to 1G, this is large enough to handle all the
> well behaving tests, and should make no difference to the test results.
> 
> There is one test, gdb.mi/mi-vla-fortran.exp that contains undefined
> behaviour, one some machines this test is known to trigger the

I suggest changing "behavior," to "behavior;".
Also "one some" -> "on some".

> max-value-size error.  However, on those machines the test would have
> failed anyway, so this commit does not change the PASS / FAIL nature of
> the test.  A later commit should modify the mi-vla-fortran.exp test to
> expect the failure case.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* lib/gdb.exp (default_gdb_start): Set max-value-size.
> 	* lib/mi-support.exp (default_mi_gdb_start): Likewise.
> 	* gdb.base/max-value-size.exp: Don't check the initial value.

Looks good. This patch is approved to go in after patch #1 is
approved.

Thank you,
Joel Brobecker Jan. 1, 2016, 9:52 a.m. UTC | #2
> > Setting the max-value-size before running any tests should prevent any
> > issues where a failing test causes gdb to bring down the testing
> > machine.
> > 
> > The maximum size is set to 1G, this is large enough to handle all the
> > well behaving tests, and should make no difference to the test results.
> > 
> > There is one test, gdb.mi/mi-vla-fortran.exp that contains undefined
> > behaviour, one some machines this test is known to trigger the
> 
> I suggest changing "behavior," to "behavior;".
> Also "one some" -> "on some".
> 
> > max-value-size error.  However, on those machines the test would have
> > failed anyway, so this commit does not change the PASS / FAIL nature of
> > the test.  A later commit should modify the mi-vla-fortran.exp test to
> > expect the failure case.
> > 
> > gdb/testsuite/ChangeLog:
> > 
> > 	* lib/gdb.exp (default_gdb_start): Set max-value-size.
> > 	* lib/mi-support.exp (default_mi_gdb_start): Likewise.
> > 	* gdb.base/max-value-size.exp: Don't check the initial value.
> 
> Looks good. This patch is approved to go in after patch #1 is
> approved.

Actually, I take that back!!!

I just realized that this only makes sense if we left the default to
unlimited, but as you saw in my previous message, this is not the case.
So I think we should simply drop the lib/ part of the patch and
just keep the gdb.base/max-value-size.exp part. We'll the wait and
see if any test triggers an unexpected failure on some platforms,
but those would be. But, my guess is that those unexpected failures
might actually be indicative of a real issue ;-).

Thanks, and sorry for the confusion!
Andrew Burgess Jan. 5, 2016, 2:14 p.m. UTC | #3
* Joel Brobecker <brobecker@adacore.com> [2016-01-01 13:52:54 +0400]:

> > > Setting the max-value-size before running any tests should prevent any
> > > issues where a failing test causes gdb to bring down the testing
> > > machine.
> > > 
> > > The maximum size is set to 1G, this is large enough to handle all the
> > > well behaving tests, and should make no difference to the test results.
> > > 
> > > There is one test, gdb.mi/mi-vla-fortran.exp that contains undefined
> > > behaviour, one some machines this test is known to trigger the
> > 
> > I suggest changing "behavior," to "behavior;".
> > Also "one some" -> "on some".
> > 
> > > max-value-size error.  However, on those machines the test would have
> > > failed anyway, so this commit does not change the PASS / FAIL nature of
> > > the test.  A later commit should modify the mi-vla-fortran.exp test to
> > > expect the failure case.
> > > 
> > > gdb/testsuite/ChangeLog:
> > > 
> > > 	* lib/gdb.exp (default_gdb_start): Set max-value-size.
> > > 	* lib/mi-support.exp (default_mi_gdb_start): Likewise.
> > > 	* gdb.base/max-value-size.exp: Don't check the initial value.
> > 
> > Looks good. This patch is approved to go in after patch #1 is
> > approved.
> 
> Actually, I take that back!!!
> 
> I just realized that this only makes sense if we left the default to
> unlimited, but as you saw in my previous message, this is not the case.
> So I think we should simply drop the lib/ part of the patch and
> just keep the gdb.base/max-value-size.exp part. We'll the wait and
> see if any test triggers an unexpected failure on some platforms,
> but those would be. But, my guess is that those unexpected failures
> might actually be indicative of a real issue ;-).
> 
> Thanks, and sorry for the confusion!

No problem.  With the default now being set in patch #1, the *.exp
changes naturally move there too.  As a result this patch is now
empty.

I've applied it as obvious ;-)

Thanks,
Andrew
diff mbox

Patch

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 93bb3bb..0673d01 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@ 
 2015-12-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* lib/gdb.exp (default_gdb_start): Set max-value-size.
+	* lib/mi-support.exp (default_mi_gdb_start): Likewise.
+	* gdb.base/max-value-size.exp: Don't check the initial value.
+
+2015-12-11  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* gdb.base/max-value-size.c: New file.
 	* gdb.base/max-value-size.exp: New file.
 
diff --git a/gdb/testsuite/gdb.base/max-value-size.exp b/gdb/testsuite/gdb.base/max-value-size.exp
index cb09ad8..21f4552 100644
--- a/gdb/testsuite/gdb.base/max-value-size.exp
+++ b/gdb/testsuite/gdb.base/max-value-size.exp
@@ -25,11 +25,9 @@  if ![runto_main] then {
     return 0
 }
 
-gdb_test "show max-value-size" \
-    "Maximum value size is unlimited." \
-    "the initial value of max-value-size is unlimited"
-
-with_test_prefix "max-value-size is 'unlimited'" {
+# The testing infrastructure does set the max-value-size, however, it
+# should always be large enough for these values.
+with_test_prefix "using initial max-value-size" {
     gdb_test "p/d one" " = 0"
     gdb_test "p/d one_hundred" " = \\{0 <repeats 100 times>\\}"
 }
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index beb97ea..215feba 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1631,6 +1631,16 @@  proc default_gdb_start { } {
 	    warning "Couldn't set the width to 0."
 	}
     }
+    # set maximum value size to 1G, no tests currently require more.
+    send_gdb "set max-value-size 1024 * 1024 * 1024\n"
+    gdb_expect 10 {
+	-re "$gdb_prompt $" {
+	    verbose "Setting max-value-size to 1G" 2
+	}
+	timeout {
+	    warning "Couldn't set the max-value-size to 1G."
+	}
+    }
     return 0
 }
 
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 9619fb3..ab64366 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -204,6 +204,16 @@  proc default_mi_gdb_start { args } {
 	    warning "Couldn't set the width to 0."
 	}
     }
+    # set maximum value size to 1G, no tests currently require more.
+    send_gdb "102-gdb-set max-value-size 1024 * 1024 * 1024\n"
+    gdb_expect 10 {
+	-re ".*102-gdb-set max-value-size \[^\r\n\]+\r\n102\\\^done\r\n$mi_gdb_prompt$" {
+	    verbose "Setting max-value-size to 1G" 2
+	}
+	timeout {
+	    warning "Couldn't set the max-value-size to 1G."
+	}
+    }
 
     # Create the new PTY for the inferior process.
     if { $separate_inferior_pty } {