aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-02-06 23:22:03 +0100
committerTom de Vries <tdevries@suse.de>2021-02-06 23:22:03 +0100
commitc0e5674584a590cdaecb7ef47d58e3aedb4be14a (patch)
tree978ea13486784b915717dc9fe663060d840f88fa
parent7a9bd3b4e219c5cd892757f86c2075ec67333903 (diff)
downloadbinutils-c0e5674584a590cdaecb7ef47d58e3aedb4be14a.zip
binutils-c0e5674584a590cdaecb7ef47d58e3aedb4be14a.tar.gz
binutils-c0e5674584a590cdaecb7ef47d58e3aedb4be14a.tar.bz2
[gdb/testsuite] Fix gdb.tui/tui-layout-asm.exp with -m32
When running test-case gdb.tui/tui-layout-asm.exp with target board unix/-m32, we run into: ... FAIL: gdb.tui/tui-layout-asm.exp: scroll to end of assembler (scroll failed) ... Comparing screen dumps (edited a bit to fit column width) before: ... 0 +--------------------------------------------------------------------+ 1 | 0x8049194 <__libc_csu_init+68> call *-0x104(%ebp,%esi,4) | 2 | 0x804919b <__libc_csu_init+75> add $0x1,%esi | 3 | 0x804919e <__libc_csu_init+78> add $0x10,%esp | 4 | 0x80491a1 <__libc_csu_init+81> cmp %esi,%ebx | 5 | 0x80491a3 <__libc_csu_init+83> jne 0x8049188 <__...> | 6 | 0x80491a5 <__libc_csu_init+85> add $0xc,%esp | 7 | 0x80491a8 <__libc_csu_init+88> pop %ebx | 8 | 0x80491a9 <__libc_csu_init+89> pop %esi | 9 | 0x80491aa <__libc_csu_init+90> pop %edi | 10 | 0x80491ab <__libc_csu_init+91> pop %ebp | 11 | 0x80491ac <__libc_csu_init+92> ret | 12 | 0x80491ad lea 0x0(%esi),%esi | 13 | 0x80491b0 <__libc_csu_fini> ret | 14 +--------------------------------------------------------------------+ ... and after: ... 0 +--------------------------------------------------------------------+ 1 | 0x804919b <__libc_csu_init+75> add $0x1,%esi | 2 | 0x804919e <__libc_csu_init+78> add $0x10,%esp | 3 | 0x80491a1 <__libc_csu_init+81> cmp %esi,%ebx | 4 | 0x80491a3 <__libc_csu_init+83> jne 0x8049188 <__...> | 5 | 0x80491a5 <__libc_csu_init+85> add $0xc,%esp | 6 | 0x80491a8 <__libc_csu_init+88> pop %ebx | 7 | 0x80491a9 <__libc_csu_init+89> pop %esi | 8 | 0x80491aa <__libc_csu_init+90> pop %edi | 9 | 0x80491ab <__libc_csu_init+91> pop %ebp | 10 | 0x80491ac <__libc_csu_init+92> ret | 11 | 0x80491ad lea 0x0(%esi),%esi | 12 | 0x80491b0 <__libc_csu_fini> ret | 13 | 0x80491b1 <__x86.get_pc_thunk.bp> mov (%esp),%ebp | 14 +--------------------------------------------------------------------+ ... it seems the mismatch comes from the extra indentation forced by the longer <__x86.get_pc_thunk.bp> that was scrolled in. Fix this by ignoring whitespace when comparing scrolled lines. Tested on x86_64-linux, using -m64 and -m32. gdb/testsuite/ChangeLog: 2021-02-06 Tom de Vries <tdevries@suse.de> PR testsuite/26922 * gdb.tui/tui-layout-asm.exp: Ignore whitespace mismatches when scrolling.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.tui/tui-layout-asm.exp7
2 files changed, 11 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5875843..222e819 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2021-02-06 Tom de Vries <tdevries@suse.de>
+
+ PR testsuite/26922
+ * gdb.tui/tui-layout-asm.exp: Ignore whitespace mismatches when
+ scrolling.
+
2021-02-05 Tom de Vries <tdevries@suse.de>
PR breakpoints/27313
diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm.exp b/gdb/testsuite/gdb.tui/tui-layout-asm.exp
index 347064a..19ce333 100644
--- a/gdb/testsuite/gdb.tui/tui-layout-asm.exp
+++ b/gdb/testsuite/gdb.tui/tui-layout-asm.exp
@@ -58,8 +58,11 @@ while (1) {
# Send the down key to GDB.
send_gdb "\033\[B"
incr down_count
- if {[Term::wait_for [string_to_regexp $line]] \
- && [Term::get_line 1] == $line} {
+ set re_line [string_to_regexp $line]
+ # Ignore whitespace mismatches.
+ regsub -all {\s+} $re_line {\s+} re_line
+ if {[Term::wait_for $re_line] \
+ && [regexp $re_line [Term::get_line 1]]} {
# We scrolled successfully.
} else {
fail "$testname (scroll failed)"