public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 2/3] gdb: Set max-value-size before running tests.
Date: Fri, 11 Dec 2015 21:38:00 -0000	[thread overview]
Message-ID: <cbc0c85480fe3181375268562f5b6f76180e6d5d.1449869723.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1449869721.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1449869721.git.andrew.burgess@embecosm.com>

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(-)

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 } {
-- 
2.5.1

  parent reply	other threads:[~2015-12-11 21:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 21:38 [PATCH 0/2] Problems with gdb.mi/mi-vla-fortran.exp Andrew Burgess
2015-12-11 21:38 ` [PATCH 3/3] gdb: Guard against undefined behaviour in mi-vla-fortran.exp Andrew Burgess
2016-01-01 11:08   ` Joel Brobecker
2016-01-05 14:15     ` Andrew Burgess
2015-12-11 21:38 ` [PATCH 1/3] gdb: New set/show max-value-size command Andrew Burgess
2016-01-01  9:43   ` Joel Brobecker
2016-01-05 14:12     ` Andrew Burgess
2016-01-05 15:55       ` Pedro Alves
2016-01-05 16:24       ` Eli Zaretskii
2016-01-06 11:41         ` Andrew Burgess
2016-01-20 10:59           ` PING: " Andrew Burgess
2016-01-20 11:23             ` Eli Zaretskii
2016-01-20 15:23             ` Andrew Burgess
2016-01-28 15:11               ` PING #2: " Andrew Burgess
2016-02-01  3:21                 ` Joel Brobecker
2016-02-13 21:40           ` [testsuite patch] testsuite regression: gdb.fortran/vla-value-sub.exp gdb.fortran/vla-value-sub-finish.exp [Re: [PATCH 1/3] gdb: New set/show max-value-size command.] Jan Kratochvil
2016-02-14  0:51             ` Andrew Burgess
2016-02-14  8:20               ` [commit] " Jan Kratochvil
2016-02-14  4:38             ` Joel Brobecker
2015-12-11 21:38 ` Andrew Burgess [this message]
2016-01-01  9:48   ` [PATCH 2/3] gdb: Set max-value-size before running tests Joel Brobecker
2016-01-01  9:53     ` Joel Brobecker
2016-01-05 14:14       ` Andrew Burgess
2016-01-01  7:34 ` [PATCH 0/2] Problems with gdb.mi/mi-vla-fortran.exp Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbc0c85480fe3181375268562f5b6f76180e6d5d.1449869723.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).