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 EB396389367C for ; Wed, 6 May 2020 09:51:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EB396389367C 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 F35BFAD9A for ; Wed, 6 May 2020 09:51:25 +0000 (UTC) Date: Wed, 6 May 2020 11:51:21 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/shlib-call.exp with gcc-8 Message-ID: <20200506095119.GA9558@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=-20.1 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 09:51:34 -0000 Hi, When running test-case gdb.base/shlib-call.exp with gcc-8 instead of gcc-7, we have: ... (gdb) step^M -main () at /data/gdb_versions/devel/src/gdb/testsuite/gdb.base/shmain.c:42^M -42 g = mainshr1(g);^M -(gdb) PASS: gdb.base/shlib-call.exp: step out of shr2 epilogue to main +main () at /data/gdb_versions/devel/src/gdb/testsuite/gdb.base/shmain.c:41^M +41 g = shr2(g);^M +(gdb) FAIL: gdb.base/shlib-call.exp: step out of shr2 epilogue to main ... This is due to the fact that gcc-8 generates more precise line info, making the instruction after the call to shr2 at 0x4008f1: ... 4008e4: 8b 05 aa 07 20 00 mov 0x2007aa(%rip),%eax # 601094 4008ea: 89 c7 mov %eax,%edi 4008ec: e8 1f fe ff ff callq 400710 4008f1: 89 05 9d 07 20 00 mov %eax,0x20079d(%rip) # 601094 ... a "recommended breakpoint location": ... [0x00000287] Special opcode 187: advance Address by 13 to 0x4008f1 and \ Line by 0 to 41 ... so when stepping out of shr2, gdb steps back onto line 41, the line containing the call to shr2. Fix this by detecting this situation and adding an extra step to reach line 42. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/shlib-call.exp with gcc-8 gdb/testsuite/ChangeLog: 2020-05-06 Tom de Vries * gdb.base/shlib-call.exp: Add extra step to reach shmain.c:42, if necessary. --- gdb/testsuite/gdb.base/shlib-call.exp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp index 806fc15157a..97e04cdbb5e 100644 --- a/gdb/testsuite/gdb.base/shlib-call.exp +++ b/gdb/testsuite/gdb.base/shlib-call.exp @@ -142,9 +142,14 @@ gdb_test_multiple "step" "step out of shr2 to main" { } -re ".*\\\}.*$gdb_prompt $" { pass "step out of shr2 to main (stopped in shr2 epilogue)" - gdb_test "step" \ - "main \\(\\) at.*g = mainshr1\\(g\\);" \ - "step out of shr2 epilogue to main" + gdb_test_multiple "step" "step out of shr2 epilogue to main" { + -re -wrap "main \\(\\) at.*g = mainshr1\\(g\\);" { + pass $gdb_test_name + } + -re -wrap "main \\(\\) at.*g = shr2\\(g\\);" { + gdb_test "step" "g = mainshr1\\(g\\);" $gdb_test_name + } + } } }