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 1E12C383F85E for ; Wed, 6 May 2020 12:27:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E12C383F85E 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 E84E9AC6C for ; Wed, 6 May 2020 12:27:59 +0000 (UTC) Date: Wed, 6 May 2020 14:27:55 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8 Message-ID: <20200506122754.GA2427@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=-18.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NORMAL_HTTP_TO_IP, NUMERIC_HTTP_ADDR, 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:28:00 -0000 Hi, When running test-case gdb.base/watchpoint-reuse-slot.exp with gcc-8 instead of gcc-7, we have: ... (gdb) PASS: $conf: watch *(buf.byte + 0 + 0)@1 stepi^M -0x00000000004004b9 34 for (i = 0; i < 100000; i++);^M +34 for (i = 0; i < 100000; i++);^M -(gdb) PASS: $conf: stepi advanced +(gdb) FAIL: $conf: stepi advanced ... where $conf is "gdb.base/watchpoint-reuse-slot.exp: hw-watch: always-inserted off: watch x watch: : width 1, iter 0: base + 0". This is due to the fact that gcc-8 generates more precise line info, making the instruction at 0x4004b9 a "recommended breakpoint location", such that gdb no longer prints the instruction address. Fix this by getting the instruction address by printing $pc. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8 gdb/testsuite/ChangeLog: 2020-05-06 Tom de Vries * gdb.base/watchpoint-reuse-slot.exp (stepi): Print $pc to get current address. --- gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp index 83b970380ca..3d3d3c479d5 100644 --- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp +++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp @@ -66,8 +66,8 @@ proc stepi {} { set srcline " for (i = 0; i < 100000; i++); /* stepi line */" set test "stepi advanced" gdb_test_multiple "stepi" $test { - -re "($hex).*[string_to_regexp $srcline]\r\n$gdb_prompt $" { - set addr $expect_out(1,string) + -re -wrap "[string_to_regexp $srcline]" { + set addr [get_valueof "/x" "\$pc" "0"] if {$addr != $cur_addr} { pass $test } else {