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

Message ID 20190110194434.842-2-pedromfc@linux.ibm.com
State New
Headers show
Series
  • [PowerPC] Fix "info vector" test in gdb.arch/altivec-regs.exp
Related show

Commit Message

Pedro Franco de Carvalho Jan. 10, 2019, 7:44 p.m.
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(-)

-- 
2.13.6

Comments

Andreas Schwab Jan. 14, 2019, 2:17 p.m. | #1
On Jan 10 2019, Pedro Franco de Carvalho <pedromfc@linux.ibm.com> wrote:

> 	gdb_expect_list when testign "info vector".


s/testign/testing/

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Pedro Franco de Carvalho Jan. 14, 2019, 7:36 p.m. | #2
Andreas Schwab <schwab@linux-m68k.org> writes:

> On Jan 10 2019, Pedro Franco de Carvalho <pedromfc@linux.ibm.com> wrote:

>

>> 	gdb_expect_list when testign "info vector".

>

> s/testign/testing/

>

> Andreas.

>

> -- 

> Andreas Schwab, schwab@linux-m68k.org

> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1

> "And now for something completely different."


Thanks! I corrected the typo when checked these in.

--
Pedro Franco de Carvalho

Patch

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\]+\\." \