[testsuite] Fix false FAILs on too long base directory

Message ID 20160108223006.GA4694@host1.jankratochvil.net
State New, archived
Headers

Commit Message

Jan Kratochvil Jan. 8, 2016, 10:30 p.m. UTC
  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
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.
  

Comments

Pedro Alves Jan. 11, 2016, 2:34 p.m. UTC | #1
On 01/08/2016 10:30 PM, Jan Kratochvil wrote:
> 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?

OK.

Thanks,
Pedro Alves
  
Jan Kratochvil Jan. 11, 2016, 9:13 p.m. UTC | #2
On Mon, 11 Jan 2016 15:34:15 +0100, Pedro Alves wrote:
> OK.

Checked in:
	c0ecb95f3dc0c3e8d1545f0a37c0c3e537e1ea96


Jan
  
Pedro Alves Jan. 12, 2016, 1:35 a.m. UTC | #3
On 01/11/2016 09:13 PM, Jan Kratochvil wrote:
> On Mon, 11 Jan 2016 15:34:15 +0100, Pedro Alves wrote:
>> OK.
> 
> Checked in:
> 	c0ecb95f3dc0c3e8d1545f0a37c0c3e537e1ea96

This actually reverted the whole

  "List inferiors/threads/pspaces in ascending order"

commit (7e0aa6aa9983).  :-P  I've reapplied it now.

Thanks,
Pedro Alves
  
Jan Kratochvil Jan. 12, 2016, 3:07 a.m. UTC | #4
On Tue, 12 Jan 2016 02:35:38 +0100, Pedro Alves wrote:
> This actually reverted the whole
> 
>   "List inferiors/threads/pspaces in ascending order"
> 
> commit (7e0aa6aa9983).  :-P  I've reapplied it now.

Oops, sorry; although in a regression-strict policy it would be appropriate to
revert it as it introduced a regression, this is why I reverted it in Fedora.


Jan
  

Patch

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]