From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gHvDBJycmF8mUgAAWB0awg (envelope-from ) for ; Tue, 27 Oct 2020 18:18:04 -0400 Received: by simark.ca (Postfix, from userid 112) id 1017E1EFBB; Tue, 27 Oct 2020 18:18:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 5C6271E590 for ; Tue, 27 Oct 2020 18:18:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7BF43959CB3; Tue, 27 Oct 2020 22:18:02 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id B9D863851C09 for ; Tue, 27 Oct 2020 22:18:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B9D863851C09 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 CC1E1AC2F for ; Tue, 27 Oct 2020 22:17:59 +0000 (UTC) Date: Tue, 27 Oct 2020 23:17:58 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/maint.exp FAILs with -readnow Message-ID: <20201027221756.GA23322@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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.base/maint.exp with target board readnow, we run into: ... FAIL: gdb.base/maint.exp: mt expand-symtabs FAIL: gdb.base/maint.exp: maint print objfiles: psymtabs FAIL: gdb.base/maint.exp: maint print psymbols -source FAIL: gdb.base/maint.exp: maint print psymbols -pc FAIL: gdb.base/maint.exp: maint info line-table with filename of symtab that \ is not currently expanded ... When using -readnow: - there are no partial symtabs - all symtabs are expanded at symbol load time and these differences from normal behaviour cause the FAILs. Update the tests for -readnow. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/maint.exp FAILs with -readnow gdb/testsuite/ChangeLog: 2020-10-27 Tom de Vries * gdb.base/maint.exp: Update for -readnow. --- gdb/testsuite/gdb.base/maint.exp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 00fe8c296c..e2340d1722 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -53,6 +53,8 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return -1 } +set readnow_p [readnow] + # The commands we test here produce many lines of output; disable "press # to continue" prompts. gdb_test_no_output "set height 0" @@ -96,7 +98,14 @@ gdb_test_multiple "mt expand-symtabs $subdir/break\[.\]c$" \ # holding "main" will already have been expanded, but if the # file is compiled with -fdebug-types-section then a second primary # symtab for break.c will be created for any types. - pass "mt expand-symtabs" + pass "$gdb_test_name" + } + -re "#compunits: ($decimal) \\(\[+\]0\\),.*$gdb_prompt $" { + if { $readnow_p } { + pass "$gdb_test_name" + } else { + fail "$gdb_test_name" + } } } gdb_test "mt set per off" ".*" "mt set per off for expand-symtabs" @@ -153,6 +162,8 @@ if { $index_cache_misses == 0 && $using_index_cache } { set have_gdb_index 1 } +set have_psyms [expr ! ( $have_gdb_index || $readnow_p )] + # # this command does not produce any output # unless there is some problem with the symtabs and psymtabs @@ -250,12 +261,12 @@ proc maint_pass_if {val name} { } maint_pass_if $header "maint print objfiles: header" -if { ! $have_gdb_index } { +if { $have_psyms } { maint_pass_if $psymtabs "maint print objfiles: psymtabs" } maint_pass_if $symtabs "maint print objfiles: symtabs" -if { ! $have_gdb_index } { +if { $have_psyms } { set psymbols_output [standard_output_file psymbols_output] set psymbols_output_re [string_to_regexp $psymbols_output] set test_list [list \ @@ -546,8 +557,12 @@ gdb_test "maint info line-table ${srcfile}" \ "symtab: \[^\n\r\]+${srcfile}.*INDEX.*LINE.*ADDRESS.*" \ "maint info line-table with filename of current symtab" -gdb_test_no_output "maint info line-table ${srcfile2}" \ - "maint info line-table with filename of symtab that is not currently expanded" +if { ! $readnow_p } { + gdb_test_no_output "maint info line-table ${srcfile2}" \ + [join \ + "maint info line-table with filename of symtab that is not" \ + " currently expanded"] +} gdb_test_no_output "maint expand-symtabs"