Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [testsuite patch] Fix false FAILs on too long base directory
Date: Fri, 08 Jan 2016 22:30:00 -0000	[thread overview]
Message-ID: <20160108223006.GA4694@host1.jankratochvil.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

Hi,

I was getting

gu (print arg0)^M
= 0x7fffffffdafb
"/unsafebuild-x86_64-redhat-linux-gnu/gdb/testsuite.unix.-m64/outputs/gdb.guile/scm-value/scm-"...^M
(gdb) FAIL: gdb.guile/scm-value.exp: verify dereferenced value
python print (arg0)^M
0x7fffffffdafd
"/unsafebuild-x86_64-redhat-linux-gnu/gdb/testsuite.unix.-m64/outputs/gdb.python/py-value/py-v"...^M
(gdb) FAIL: gdb.python/py-value.exp: verify dereferenced value

and also:

(gdb) p argv[0]^M
$2 = 0x7fffffffd832 "/home/jkratoch/redhat/gdb-test-", 'x' <repeats 169
times>...^M
(gdb) FAIL: gdb.guile/scm-value.exp: argv[0] should be available on this
target

OK for check-in?


Thanks,
Jan

[-- Attachment #2: longdirname.patch --]
[-- Type: text/plain, Size: 2833 bytes --]

gdb/testsuite/ChangeLog
2016-01-08  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.guile/scm-value.exp (test_value_in_inferior): Set print elements
	and repeats to unlimited.
	* gdb.python/py-value.exp: Likewise.
	* lib/gdb.exp (gdb_has_argv0): Save and temporarily set print elements
	and repeats to unlimited.

diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp
index 8c858d5..1d07c9f 100644
--- a/gdb/testsuite/gdb.guile/scm-value.exp
+++ b/gdb/testsuite/gdb.guile/scm-value.exp
@@ -91,6 +91,8 @@ proc test_value_in_inferior {} {
     global has_argv0
     set test "verify dereferenced value"
     if { $has_argv0 } {
+	gdb_test_no_output "set print elements unlimited" ""
+	gdb_test_no_output "set print repeats unlimited" ""
 	gdb_test "gu (print arg0)" "0x.*$testfile\"" $test
     } else {
 	unsupported $test
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index e60bd9e..a9dbe97 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -226,6 +226,8 @@ proc test_value_in_inferior {} {
   global has_argv0
   set test "verify dereferenced value"
   if { $has_argv0 } {
+    gdb_test_no_output "set print elements unlimited" ""
+    gdb_test_no_output "set print repeats unlimited" ""
     gdb_test "python print (arg0)" "0x.*$testfile\"" $test
   } else {
     unsupported $test
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 015e202..52220d0 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4896,24 +4896,44 @@ gdb_caching_proc gdb_has_argv0 {
 	    }
 	}
 
+	set old_elements "200"
+	set test "show print elements"
+	gdb_test_multiple $test $test {
+	    -re "Limit on string chars or array elements to print is (\[^\r\n\]+)\\.\r\n$gdb_prompt $" {
+		set old_elements $expect_out(1,string)
+	    }
+	}
+	set old_repeats "200"
+	set test "show print repeats"
+	gdb_test_multiple $test $test {
+	    -re "Threshold for repeated print elements is (\[^\r\n\]+)\\.\r\n$gdb_prompt $" {
+		set old_repeats $expect_out(1,string)
+	    }
+	}
+	gdb_test_no_output "set print elements unlimited" ""
+	gdb_test_no_output "set print repeats unlimited" ""
+
+	set retval 0
 	# Check whether argc is 1.
 	gdb_test_multiple "p argc" "p argc" {
 	    -re " = 1\r\n${gdb_prompt} $" {
 
 		gdb_test_multiple "p argv\[0\]" "p argv\[0\]" {
 		    -re " = $hex \".*[file tail $exe]\"\r\n${gdb_prompt} $" {
-			return 1
+			set retval 1
 		    }
 		    -re "${gdb_prompt} $" {
-			return 0
 		    }
 		}
 	    }
 	    -re "${gdb_prompt} $" {
-		return 0
 	    }
 	}
-	return 0
+	
+	gdb_test_no_output "set print elements $old_elements" ""
+	gdb_test_no_output "set print repeats $old_repeats" ""
+
+	return $retval
     }
 
     set result [gdb_has_argv0_1 $exe]

             reply	other threads:[~2016-01-08 22:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 22:30 Jan Kratochvil [this message]
2016-01-11 14:34 ` Pedro Alves
2016-01-11 21:13   ` [commit] " Jan Kratochvil
2016-01-12  1:35     ` Pedro Alves
2016-01-12  3:07       ` Jan Kratochvil

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=20160108223006.GA4694@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.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