From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oJNNLqJyHWD1JAAAWB0awg (envelope-from ) for ; Fri, 05 Feb 2021 11:30:26 -0500 Received: by simark.ca (Postfix, from userid 112) id B73C91EFCB; Fri, 5 Feb 2021 11:30:26 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 68BE71EF7A for ; Fri, 5 Feb 2021 11:30:26 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2DD8F39F9C11; Fri, 5 Feb 2021 16:30:26 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 72AFB39F4412 for ; Fri, 5 Feb 2021 16:30:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 72AFB39F4412 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 925B7AC97; Fri, 5 Feb 2021 16:30:22 +0000 (UTC) Date: Fri, 5 Feb 2021 17:30:20 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix gdb.tui/tui-layout-asm.exp with -m32 Message-ID: <20210205163019.GA21614@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, 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. Any comments? Thanks, - Tom [gdb/testsuite] Fix gdb.tui/tui-layout-asm.exp with -m32 gdb/testsuite/ChangeLog: 2021-02-05 Tom de Vries PR testsuite/26922 * gdb.tui/tui-layout-asm.exp: Ignore whitespace mismatches when scrolling. --- gdb/testsuite/gdb.tui/tui-layout-asm.exp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm.exp b/gdb/testsuite/gdb.tui/tui-layout-asm.exp index 347064aacc6..19ce333ca9e 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)"