From: Tom de Vries Date: Wed, 28 Oct 2020 20:04:12 +0000 (+0100) Subject: [gdb/testsuite] Fix gdb.rust/traits.exp with -readnow X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b68fd45a80196d1462c0fd1e174cead99b3eaeb;p=binutils-gdb.git [gdb/testsuite] Fix gdb.rust/traits.exp with -readnow With test-case gdb.rust/traits.exp and target board readnow we get: ... FAIL: gdb.rust/traits.exp: print *td FAIL: gdb.rust/traits.exp: print *tu ... Mark these FAILs as KFAILs. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries * lib/gdb.exp (readnow): Handle arg. * gdb.rust/traits.exp: Add KFAILs for -readnow. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e500489f992..a0cdd70b760 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-10-28 Tom de Vries + + * lib/gdb.exp (readnow): Handle arg. + * gdb.rust/traits.exp: Add KFAILs for -readnow. + 2020-10-28 Tom de Vries * gdb.base/relocate.exp: Update regexp for -readnow. diff --git a/gdb/testsuite/gdb.rust/traits.exp b/gdb/testsuite/gdb.rust/traits.exp index 41e58e1fef7..d237b928720 100644 --- a/gdb/testsuite/gdb.rust/traits.exp +++ b/gdb/testsuite/gdb.rust/traits.exp @@ -43,5 +43,13 @@ if {![runto ${srcfile}:$line]} { return -1 } +set readnow_p [readnow $binfile] + +if { $readnow_p } { + setup_kfail "gdb/26799" *-*-* +} gdb_test "print *td" " = 23.5" +if { $readnow_p } { + setup_kfail "gdb/26799" *-*-* +} gdb_test "print *tu" " = 23" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ef96209b0dc..003bd3069ec 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -7318,8 +7318,13 @@ gdb_caching_proc supports_fcf_protection { # Return 1 if symbols were read in using -readnow. Otherwise, return 0. -proc readnow { } { - set cmd "maint print objfiles" +proc readnow { args } { + if { [llength $args] == 1 } { + set re [lindex $args 0] + } else { + set re "" + } + set cmd "maint print objfiles $re" gdb_test_multiple $cmd "" { -re -wrap "\r\n.gdb_index: faked for \"readnow\"\r\n.*" { return 1