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 8865F383F85E for ; Wed, 6 May 2020 12:49:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8865F383F85E 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.220.254]) by mx2.suse.de (Postfix) with ESMTP id 60056AC22 for ; Wed, 6 May 2020 12:49:13 +0000 (UTC) Date: Wed, 6 May 2020 14:49:09 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.reverse/consecutive-{precsave,reverse}.exp with gcc-8 Message-ID: <20200506124907.GA5842@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=-19.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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: Wed, 06 May 2020 12:49:13 -0000 Hi, When running test-cases gdb.reverse/consecutive-precsave.exp and gdb.reverse/consecutive-reverse.exp with gcc-8, we get: ... FAIL: gdb.reverse/consecutive-precsave.exp: stopped at bp, 2nd instr FAIL: gdb.reverse/consecutive-reverse.exp: stopped at bp, 2nd instr ... These FAILs are duplicates of the FAILs fixed in commit 7c99e7e2b08 "[gdb/testsuite] Fix gdb.base/consecutive.exp with gcc-8". Fix these in the same manner. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.reverse/consecutive-{precsave,reverse}.exp with gcc-8 gdb/testsuite/ChangeLog: 2020-05-06 Tom de Vries * gdb.reverse/consecutive-precsave.exp: Handle if instruction after breakpoint is at a "recommended breakpoint location". * gdb.reverse/consecutive-reverse.exp: Same. --- gdb/testsuite/gdb.reverse/consecutive-precsave.exp | 15 ++++++++++++++- gdb/testsuite/gdb.reverse/consecutive-reverse.exp | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp index 9aaa1314d25..dec501d589b 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp @@ -35,6 +35,8 @@ if [supports_process_record] { gdb_test_no_output "record" "turn on process record" } +set is_stmt [is_stmt_addresses $srcfile] + set end_location [gdb_get_line_number "end of main" ] gdb_test "break $end_location" \ "Breakpoint $decimal at .*$srcfile, line $end_location\." \ @@ -79,7 +81,7 @@ gdb_test "break \*$foo2_addr" "Breakpoint $decimal at $foo2_addr: file .*" \ set testmsg "stopped at bp, 2nd instr" gdb_test_multiple "step" $testmsg { - -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" { + -re -wrap "Breakpoint $decimal, ($hex) in foo.*" { set stop_addr $expect_out(1,string) if [eval expr "$foo2_addr == $stop_addr"] then { pass "stopped at bp, 2nd instr" @@ -87,6 +89,17 @@ gdb_test_multiple "step" $testmsg { fail "stopped at bp, 2nd instr (wrong address)" } } + -re -wrap "Breakpoint $decimal, foo.*" { + set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"] + set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt] + if { ! $stop_addr_is_stmt } { + fail "stopped at bp, 2nd instr (missing hex prefix)" + } elseif [eval expr "$foo2_addr == $stop_addr"] then { + pass "stopped at bp, 2nd instr" + } else { + fail "stopped at bp, 2nd instr (wrong address)" + } + } } ### diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp index 33834875d49..ff03e6744a4 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp @@ -33,6 +33,8 @@ if [supports_process_record] { gdb_test_no_output "record" "turn on process record" } +set is_stmt [is_stmt_addresses $srcfile] + gdb_breakpoint foo gdb_test "continue" "Breakpoint $decimal, foo .*" \ "continue to breakpoint in foo" @@ -59,7 +61,7 @@ gdb_test "break \*$foo2_addr" "Breakpoint $decimal at $foo2_addr: file .*" \ set testmsg "stopped at bp, 2nd instr" gdb_test_multiple "step" $testmsg { - -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" { + -re -wrap "Breakpoint $decimal, ($hex) in foo.*" { set stop_addr $expect_out(1,string) if [eval expr "$foo2_addr == $stop_addr"] then { pass "stopped at bp, 2nd instr" @@ -67,6 +69,17 @@ gdb_test_multiple "step" $testmsg { fail "stopped at bp, 2nd instr (wrong address)" } } + -re -wrap "Breakpoint $decimal, foo.*" { + set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"] + set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt] + if { ! $stop_addr_is_stmt } { + fail "stopped at bp, 2nd instr (missing hex prefix)" + } elseif [eval expr "$foo2_addr == $stop_addr"] then { + pass "stopped at bp, 2nd instr" + } else { + fail "stopped at bp, 2nd instr (wrong address)" + } + } } ###