Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix use of verbose in gdb/jit-*.exp
Date: Wed, 3 Jun 2020 17:19:06 +0200	[thread overview]
Message-ID: <20200603151905.GA23083@delia> (raw)

Hi,

When running the gdb/jit-*.exp tests with runtest -v, I get:
...
ERROR: internal buffer is full.
UNRESOLVED: gdb.base/jit-elf-so.exp: one_jit_test-1: maintenance print objfiles
ERROR: internal buffer is full.
UNRESOLVED: gdb.base/jit-elf-so.exp: one_jit_test-2: maintenance print objfiles
ERROR: internal buffer is full.
UNRESOLVED: gdb.base/jit-elf.exp: one_jit_test-1: maintenance print objfiles
ERROR: internal buffer is full.
UNRESOLVED: gdb.base/jit-elf.exp: one_jit_test-2: maintenance print objfiles
ERROR: internal buffer is full.
UNRESOLVED: gdb.base/jit-elf.exp: attach: one_jit_test-2: maintenance print objfiles
ERROR: internal buffer is full.
UNRESOLVED: gdb.base/jit-elf.exp: PIE: one_jit_test-1: maintenance print objfiles
FAIL: gdb.base/jit-reader.exp: jit-reader-load
FAIL: gdb.base/jit-reader.exp: with jit-reader: before mangling: bt works
FAIL: gdb.base/jit-reader.exp: with jit-reader: after mangling: bt works
FAIL: gdb.base/jit-reader.exp: with jit-reader again: jit-reader-load
FAIL: gdb.base/jit-reader.exp: with jit-reader again: bt
...

This is the consequence of the use of global verbose in these tests, which is
used to change the actual test, rather than be more verbose about it.

Fix this by defining a global test_verbose in each test, and using that
instead.

Tested on x86_64-linux using runtest -v.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix use of verbose in gdb/jit-*.exp

gdb/testsuite/ChangeLog:

2020-06-03  Tom de Vries  <tdevries@suse.de>

	PR testsuite/25609
	* gdb.base/jit-elf-so.exp: Don't modify testing behaviour based on
	value of global verbose.
	* gdb.base/jit-elf.exp: Same.
	* gdb.base/jit-reader.exp: Same.

---
 gdb/testsuite/gdb.base/jit-elf-so.exp | 9 ++++++---
 gdb/testsuite/gdb.base/jit-elf.exp    | 9 ++++++---
 gdb/testsuite/gdb.base/jit-reader.exp | 8 ++++++--
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/gdb/testsuite/gdb.base/jit-elf-so.exp b/gdb/testsuite/gdb.base/jit-elf-so.exp
index 51c1d33ff9..193d330acb 100644
--- a/gdb/testsuite/gdb.base/jit-elf-so.exp
+++ b/gdb/testsuite/gdb.base/jit-elf-so.exp
@@ -28,6 +28,9 @@ if {[get_compiler_info]} {
 
 load_lib jit-elf-helpers.exp
 
+# Increase this to see more detail.
+set test_verbose 0
+
 # The "real" main of this test, which loads jit-elf-main
 # as a shared library.
 set main_loader_basename jit-elf-dlmain
@@ -73,7 +76,7 @@ proc compile_jit_dlmain {options} {
 proc one_jit_test {solib_binfiles_target match_str} {
     set count [llength $solib_binfiles_target]
     with_test_prefix "one_jit_test-$count" {
-	global verbose
+	global test_verbose
 	global main_loader_binfile main_loader_srcfile
 	global main_solib_binfile main_solib_srcfile
 
@@ -81,7 +84,7 @@ proc one_jit_test {solib_binfiles_target match_str} {
 	gdb_load_shlib $main_solib_binfile
 
 	# This is just to help debugging when things fail
-	if {$verbose > 0} {
+	if {$test_verbose > 0} {
 	    gdb_test "set debug jit 1"
 	}
 
@@ -121,7 +124,7 @@ proc one_jit_test {solib_binfiles_target match_str} {
 	gdb_test "info function jit_function" "$match_str"
 
 	# This is just to help debugging when things fail
-	if {$verbose > 0} {
+	if {$test_verbose > 0} {
 	    gdb_test "maintenance print objfiles"
 	    gdb_test "maintenance info break"
 	}
diff --git a/gdb/testsuite/gdb.base/jit-elf.exp b/gdb/testsuite/gdb.base/jit-elf.exp
index 78a19c2c9a..b9c2318d00 100644
--- a/gdb/testsuite/gdb.base/jit-elf.exp
+++ b/gdb/testsuite/gdb.base/jit-elf.exp
@@ -25,6 +25,9 @@ if {[get_compiler_info]} {
 
 load_lib jit-elf-helpers.exp
 
+# Increase this to see more detail.
+set test_verbose 0
+
 # The main code that loads and registers JIT objects.
 set main_basename "jit-elf-main"
 set main_srcfile ${srcdir}/${subdir}/${main_basename}.c
@@ -82,13 +85,13 @@ proc one_jit_test {jit_solibs_target match_str reattach} {
     set count [llength $jit_solibs_target]
 
     with_test_prefix "one_jit_test-$count" {
-	global verbose
+	global test_verbose
 	global main_binfile main_srcfile
 
 	clean_restart ${main_binfile}
 
 	# This is just to help debugging when things fail
-	if {$verbose > 0} {
+	if {$test_verbose > 0} {
 	    gdb_test "set debug jit 1"
 	}
 
@@ -117,7 +120,7 @@ proc one_jit_test {jit_solibs_target match_str reattach} {
 	gdb_test "info function ^jit_function" "$match_str"
 
 	# This is just to help debugging when things fail
-	if {$verbose > 0} {
+	if {$test_verbose > 0} {
 	    gdb_test "maintenance print objfiles"
 	    gdb_test "maintenance info break"
 	}
diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index c0af2fc6a1..1821bdcd33 100644
--- a/gdb/testsuite/gdb.base/jit-reader.exp
+++ b/gdb/testsuite/gdb.base/jit-reader.exp
@@ -32,6 +32,10 @@ if {[get_compiler_info]} {
     return 1
 }
 
+
+# Increase this to see more detail.
+set test_verbose 0
+
 set jit_host_src $srcfile
 set jit_host_bin $binfile
 
@@ -104,7 +108,7 @@ proc info_registers_current_frame {sp} {
 proc jit_reader_test {} {
     global jit_host_bin
     global jit_reader_bin
-    global verbose
+    global test_verbose
     global hex decimal
 
     set any "\[^\r\n\]*"
@@ -112,7 +116,7 @@ proc jit_reader_test {} {
     clean_restart $jit_host_bin
     gdb_load_shlib $jit_reader_bin
 
-    if {$verbose > 0} {
+    if {$test_verbose > 0} {
 	gdb_test_no_output "set debug jit 1"
     }
 


                 reply	other threads:[~2020-06-03 15:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200603151905.GA23083@delia \
    --to=tdevries@suse.de \
    --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