aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2016-01-11 22:12:16 +0100
committerJan Kratochvil <jan.kratochvil@redhat.com>2016-01-11 22:12:16 +0100
commitc0ecb95f3dc0c3e8d1545f0a37c0c3e537e1ea96 (patch)
tree72686402952a13042e8e50ea6e58834c0a4d5255 /gdb/testsuite/lib
parentb835bb5265d614fd8a4759f284b987b365292c36 (diff)
downloadgdb-c0ecb95f3dc0c3e8d1545f0a37c0c3e537e1ea96.zip
gdb-c0ecb95f3dc0c3e8d1545f0a37c0c3e537e1ea96.tar.gz
gdb-c0ecb95f3dc0c3e8d1545f0a37c0c3e537e1ea96.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp28
-rw-r--r--gdb/testsuite/lib/mi-support.exp13
2 files changed, 36 insertions, 5 deletions
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]
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 7f9a3f5..cb8227d 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1968,8 +1968,19 @@ proc mi_load_shlibs { args } {
mi_gdb_test "set solib-search-path [file dirname [lindex $args 0]]" "\^done" ""
}
-proc mi_check_thread_states { states test } {
+proc mi_reverse_list { list } {
+ if { [llength $list] <= 1 } {
+ return $list
+ }
+ set tail [lrange $list 1 [llength $list]]
+ set rtail [mi_reverse_list $tail]
+ lappend rtail [lindex $list 0]
+ return $rtail
+}
+
+proc mi_check_thread_states { xstates test } {
global expect_out
+ set states [mi_reverse_list $xstates]
set pattern ".*\\^done,threads=\\\["
foreach s $states {
set pattern "${pattern}(.*)state=\"$s\""