[PATCH] [PowerPC] Fix "info vector" test in gdb.arch/altivec-regs.exp

Pedro Franco de Carvalho
2019-01-10T19:45:25Z

This patch fixes one of the tests in gdb.arch/altivec-regs.exp that
was passing an incorrect list to gdb_expect_list, which always
matched.

gdb/testsuite/ChangeLog:
2018-01-10 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>

* gdb.arch/altivec-regs.exp: Fix the list passed to
gdb_expect_list when testign "info vector".
---
gdb/testsuite/gdb.arch/altivec-regs.exp | 43 ++++-----------------------------
1 file changed, 5 insertions(+), 38 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/altivec-regs.exp b/gdb/testsuite/gdb.arch/altivec-regs.exp
index 5647fb5e86..d23039244f 100644
--- a/gdb/testsuite/gdb.arch/altivec-regs.exp
+++ b/gdb/testsuite/gdb.arch/altivec-regs.exp
@@ -117,47 +117,14 @@ gdb_test "print \$vrsave" ".* = 1" "print vrsave"
gdb_test "print \$vscr" ".* = 1" "print vscr"

for {set i 0} {$i < 32} {incr i 1} {
- set pattern$i ".*vr$i.*"
- append pattern$i $vector_register
+ lappend pattern_list "vr$i\[ \t\]+$vector_register"
}

+lappend pattern_list "vscr\[ \t\]+0x1"
+lappend pattern_list "vrsave\[ \t\]+0x1"
+
send_gdb "info vector\n"
-gdb_expect_list "info vector" ".*$gdb_prompt $" {
-[$pattern0]
-[$pattern1]
-[$pattern2]
-[$pattern3]
-[$pattern4]
-[$pattern5]
-[$pattern6]
-[$pattern7]
-[$pattern8]
-[$pattern9]
-[$pattern10]
-[$pattern11]
-[$pattern12]
-[$pattern13]
-[$pattern14]
-[$pattern15]
-[$pattern16]
-[$pattern17]
-[$pattern18]
-[$pattern19]
-[$pattern20]
-[$pattern21]
-[$pattern22]
-[$pattern23]
-[$pattern24]
-[$pattern25]
-[$pattern26]
-[$pattern27]
-[$pattern28]
-[$pattern29]
-[$pattern30]
-[$pattern31]
-"\[ \t\n\r\]+vscr\[ \t\]+0x1"
-"\[ \t\n\r\]+vrsave\[ \t\]+0x1"
-}
+gdb_expect_list "info vector" ".*$gdb_prompt $" $pattern_list

gdb_test "break vector_fun" \
"Breakpoint 2 at.*altivec-regs.c, line \[0-9\]+\\." \
--
2.13.6