http://sourceware.org/ml/gdb-patches/2016-01/msg00146.html Subject: [testsuite patch] Fix false FAILs on too long base directory --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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' ...^M (gdb) FAIL: gdb.guile/scm-value.exp: argv[0] should be available on this target OK for check-in? Thanks, Jan --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="longdirname.patch" gdb/testsuite/ChangeLog 2016-01-08 Jan Kratochvil * 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] --r5Pyd7+fXNt84Ff3--