From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id XpBHHnlmBWAdGgAAWB0awg (envelope-from ) for ; Mon, 18 Jan 2021 05:44:09 -0500 Received: by simark.ca (Postfix, from userid 112) id 70F001EF80; Mon, 18 Jan 2021 05:44:09 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 18AE91E945 for ; Mon, 18 Jan 2021 05:44:09 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79C693AA9905; Mon, 18 Jan 2021 10:44:08 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id B0DCC3846013 for ; Mon, 18 Jan 2021 10:44:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0DCC3846013 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 CE903AE6E for ; Mon, 18 Jan 2021 10:44:05 +0000 (UTC) Date: Mon, 18 Jan 2021 11:44:04 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 Message-ID: <20210118104402.GA31253@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.opt/solib-intra-step.exp with target board unix/-m32, we run into: ... (gdb) step^M __x86.get_pc_thunk.bx () at ../sysdeps/i386/crti.S:66^M 66 ../sysdeps/i386/crti.S: No such file or directory.^M (gdb) FAIL: gdb.opt/solib-intra-step.exp: first-hit (optimized) ... The thunk is a helper function for PIC, and given that we have line info for it, we step into. Fix this by allowing the step into the thunk, and stepping out of it. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 gdb/testsuite/ChangeLog: 2021-01-18 Tom de Vries * gdb.opt/solib-intra-step.exp: Handle stepping into thunk. --- gdb/testsuite/gdb.opt/solib-intra-step.exp | 55 +++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp index 14b34eabd50..ad19895d890 100644 --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp @@ -48,33 +48,54 @@ if ![runto_main] then { } set test "first-hit" +set state 0 gdb_test_multiple "step" $test { - -re " first-hit .*\r\n$gdb_prompt $" { - pass $test + -re -wrap " first-hit .*" { + gdb_assert { $state != -1 } $test } - -re " first-retry .*\r\n$gdb_prompt $" { - gdb_test "step" " first-hit .*" "first-hit (optimized)" + -re -wrap " first-retry .*" { + if { $state != 0 } { + set state -1 + } else { + set state 1 + } + send_gdb "step\n" + exp_continue + } + -re -wrap "get_pc_thunk.*" { + if { $state != 1 } { + set state -1 + } else { + set state 2 + } + send_gdb "step\n" + exp_continue } } set test "second-hit" +set state 0 gdb_test_multiple "step" $test { - -re " second-hit .*\r\n$gdb_prompt $" { - pass $test + -re -wrap " second-hit .*" { + gdb_assert { $state != -1 } $test } - -re " first-retry .*\r\n$gdb_prompt $" { - set test "second-hit (optimized 1)" - gdb_test_multiple "step" $test { - -re " second-hit .*\r\n$gdb_prompt $" { - pass $test - } - -re " first-hit .*\r\n$gdb_prompt $" { - gdb_test "step" " second-hit .*" "second-hit (optimized 2)" - } + -re -wrap " second-retry .*" { + if { $state != 0 } { + set state -1 + } else { + set state 1 } + send_gdb "step\n" + exp_continue } - -re " second-retry .*\r\n$gdb_prompt $" { - gdb_test "step" " second-hit .*" "second-hit (optimized 3)" + -re -wrap "get_pc_thunk.*" { + if { $state != 1 } { + set state -1 + } else { + set state 2 + } + send_gdb "step\n" + exp_continue } }