From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KImsH9L0B2GhSQAAWB0awg (envelope-from ) for ; Mon, 02 Aug 2021 09:36:18 -0400 Received: by simark.ca (Postfix, from userid 112) id 7F2B31EDFB; Mon, 2 Aug 2021 09:36:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 DEDBE1E4A3 for ; Mon, 2 Aug 2021 09:36:17 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A10673833003 for ; Mon, 2 Aug 2021 13:36:17 +0000 (GMT) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id B0F80383D80C for ; Mon, 2 Aug 2021 13:33:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0F80383D80C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D900821BA6 for ; Mon, 2 Aug 2021 13:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627911201; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=TAZN+KhMwRBbppfq1OOAJptN4j+EyRvc38pYPBBR1xw=; b=DLSaBmwQTlYi8Dk1O2l0d21Fj/cnta8PxSBylL7DFASukP+Zowe47ll+3rLT2fVckUkUSV vcK5p3QsaV4rF2ZDqe6fGD36K32ilRJT3X/s55QjwsQLwIoA6IMHoxHt0mc6KuOT9iQcUx PRUZgz1UdPmM8AeNxACfbFjFzI0L+Mg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627911201; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=TAZN+KhMwRBbppfq1OOAJptN4j+EyRvc38pYPBBR1xw=; b=m2sTy+sf2JOAwqSBERcRwtUcAsHMo8X29PXyUOXe+AplVrl4iEkYBTLpJAdHFgxf2wI2w/ ommpB4SzbahD5fCA== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id C7A2013983 for ; Mon, 2 Aug 2021 13:33:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id plDDLyH0B2E+ZwAAGKfGzw (envelope-from ) for ; Mon, 02 Aug 2021 13:33:21 +0000 Date: Mon, 2 Aug 2021 15:33:20 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/dw2-using-debug-str.exp with cc-with-gdb-index Message-ID: <20210802133318.GA8640@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+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running with target board cc-with-gdb-index, we run into: ... (gdb) file dw2-using-debug-str-no-debug-str^M Reading symbols from dw2-using-debug-str-no-debug-str...^M Dwarf Error: DW_FORM_strp used without required section^M (gdb) FAIL: gdb.dwarf2/dw2-using-debug-str.exp: file dw2-using-debug-str ... The test expects the dwarf error, but has no matching pattern for the entire output. Fix this by updating the regexp. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/dw2-using-debug-str.exp with cc-with-gdb-index gdb/testsuite/ChangeLog: 2021-08-02 Tom de Vries * gdb.dwarf2/dw2-using-debug-str.exp: Update regexp to match cc-with-gdb-index output. --- gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp | 28 ++++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp index 62febdb0a99..09f58d38f7b 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp @@ -115,28 +115,32 @@ if {[run_on_host "objcopy" [gdb_find_objcopy] "$args"]} { # executable we're going to get an error, which we check for below. clean_restart +set line1 "Reading symbols from \[^\r\n\]+" +set dwarf_error "Dwarf Error: DW_FORM_strp used without required section" + # This pattern is hit when GDB does not use -readnow (i.e. the default # behaviour). set pattern1 \ [multi_line \ - "Reading symbols from \[^\r\n\]+" \ - "Dwarf Error: DW_FORM_strp used without required section" \ + $line1 \ + $dwarf_error \ "\\(No debugging symbols \[^\r\n\]+\\)"] # This pattern is hit when GDB does use -readnow (e.g. running with # --target_board=readnow). set pattern2 \ [multi_line \ - "Reading symbols from \[^\r\n\]+" \ + $line1 \ "Expanding full symbols from \[^\r\n\]+" \ - "Dwarf Error: DW_FORM_strp used without required section"] + $dwarf_error] + +# This pattern is hit when gcc adds an index (e.g. running with +# --target_board=cc-with-gdb-index). +set pattern3 \ + [multi_line \ + $line1 \ + $dwarf_error] # Load the executable, we expect an error from the DWARF parser. -gdb_test_multiple "file $binfile_no_debug_str" "file $testfile" { - -wrap -re $pattern1 { - pass $gdb_test_name - } - -re -wrap "$pattern2" { - pass $gdb_test_name - } -} +gdb_test "file $binfile_no_debug_str" "($pattern1|$pattern2|$pattern3)" \ + "file $testfile"