From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id B177F385E82F for ; Sun, 15 Mar 2020 09:44:23 +0000 (GMT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 66814AC24 for ; Sun, 15 Mar 2020 09:44:22 +0000 (UTC) Date: Sun, 15 Mar 2020 10:44:20 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix check-read1 FAIL with gdb.base/maint.exp Message-ID: <20200315094419.GA7682@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-Spam-Status: No, score=-25.0 required=5.0 tests=GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Sun, 15 Mar 2020 09:44:24 -0000 Hi, When running test-case gdb.base/maint.exp with check-read1, I run into: ... FAIL: gdb.base/maint.exp: (timeout) maint print objfiles ... The FAIL happens because command output contains long lines like this: ... file1 at $hex, file2 at $hex, ..., $file$n at $hex, ... F.i., such a line for libc.so.debug contains 82000 chars. Fix this this by reading long lines bit by bit. Also, replace the testing of the command output formulated using a gdb_send combined with gdb_expect-in-a-loop, with a regular gdb_test_multiple with exp_continue. Tested on x86_64-linux, with make targets check and check-read1. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix check-read1 FAIL with gdb.base/maint.exp gdb/testsuite/ChangeLog: 2020-03-15 Tom de Vries * gdb.base/maint.exp: Use exp_continue in long lines for "maint print objfiles". --- gdb/testsuite/gdb.base/maint.exp | 45 +++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index f6eeb98a20..3431f2c6dc 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -215,7 +215,7 @@ gdb_expect { # There aren't any ... gdb_test_no_output "maint print dummy-frames" -send_gdb "maint print objfiles\n" + # To avoid timeouts, we avoid expects with many .* patterns that match # many lines. Instead, we keep track of which milestones we've seen @@ -224,31 +224,24 @@ send_gdb "maint print objfiles\n" set header 0 set psymtabs 0 set symtabs 0 -set keep_looking 1 - -while {$keep_looking} { - gdb_expect { - - -re "\r\n" { - set output $expect_out(buffer) - if {[regexp ".*Object file.*maint($EXEEXT)?: Objfile at ${hex}" $output]} { - set header 1 - } - if {[regexp ".*Psymtabs:\[\r\t \]+\n" $output]} { - set psymtabs 1 - } - if {[regexp ".*Symtabs:\[\r\t \]+\n" $output]} { - set symtabs 1 - } - } - - -re ".*$gdb_prompt $" { - set keep_looking 0 - } - timeout { - fail "(timeout) maint print objfiles" - set keep_looking 0 - } +gdb_test_multiple "maint print objfiles" "" -lbl { + -re "\r\nObject file.*maint($EXEEXT)?: Objfile at ${hex}" { + set header 1 + exp_continue + } + -re "\r\nPsymtabs:\[\r\t \]+" { + set psymtabs 1 + exp_continue + } + -re "\r\nSymtabs:\[\r\t \]+\n" { + set symtabs 1 + exp_continue + } + -re " at $hex," { + exp_continue + } + -re -wrap "" { + pass $gdb_test_name } }