testsuite: Fix false FAILs on too long base directory

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

gdb/testsuite/ChangeLog
2016-01-11  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.
This commit is contained in:
Jan Kratochvil 2016-01-11 22:12:16 +01:00
parent b835bb5265
commit c0ecb95f3d
31 changed files with 301 additions and 126 deletions

View file

@ -230,10 +230,10 @@ with_test_prefix "is_valid" {
"check inferior validity 3"
gdb_test_no_output "remove-inferiors 2" "remove-inferiors 3"
gdb_test "python print (inf_list\[0\].is_valid())" "True" \
gdb_test "python print (inf_list\[0\].is_valid())" "False" \
"check inferior validity 4"
gdb_test "python print (inf_list\[1\].is_valid())" "False" \
gdb_test "python print (inf_list\[1\].is_valid())" "True" \
"check inferior validity 5"
}

View file

@ -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