From patchwork Fri Feb 26 14:03:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 11109 Received: (qmail 87743 invoked by alias); 26 Feb 2016 14:04:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 87615 invoked by uid 89); 26 Feb 2016 14:04:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=1511, 15, 11, HX-Received:10.67.7.197, Hx-languages-length:2302 X-HELO: mail-pa0-f65.google.com Received: from mail-pa0-f65.google.com (HELO mail-pa0-f65.google.com) (209.85.220.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 26 Feb 2016 14:04:02 +0000 Received: by mail-pa0-f65.google.com with SMTP id fl4so4535293pad.2 for ; Fri, 26 Feb 2016 06:04:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5EayDZ35AItLhfugOXe9r2RLW4Ip8OqwK+uHoYF483U=; b=A4ukyuXz6swGBzkFYaYB9mJvuo9IH8U9Sbs2xKpLsTCKlNlGcI70MdEQvEfMSVMSum /Fb+7dZ4+gEGmZsb0S4fPSetz9vkiLgPixpL4ved4cRVByGnoU722dW7VMJGcoy+o4ui sWsZwYywDLGxy4rfum8pq27xIthXlW2o7OLAWywYvthzIb1KhKX3rI7rysg/nbQGOFUP PVT6BS0P9E5m9KiJhITXFcmiWqaX+XMMO8b20K0GaRpIMDP4yUAecoaW91mAgz6JjkTD 0PPxlyzyqd2vUSB06p7fL1Kacb/UvZJqTDdEWKE07u5FXBH3MAtNgXBcM4Iiyp7auZ2w /CWg== X-Gm-Message-State: AD7BkJJmW7WGCW1W1q+s7mc0of0BZH1nwbx6Z4S89hPGyflTbNSUr6kdWEN4A8Hg2Wtpdw== X-Received: by 10.67.7.197 with SMTP id de5mr2235368pad.105.1456495439826; Fri, 26 Feb 2016 06:03:59 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id d81sm19745089pfj.77.2016.02.26.06.03.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Feb 2016 06:03:59 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 3/7] Step over syscalll insn with disp-step on and off Date: Fri, 26 Feb 2016 14:03:42 +0000 Message-Id: <1456495426-7520-4-git-send-email-yao.qi@linaro.org> In-Reply-To: <1456495426-7520-1-git-send-email-yao.qi@linaro.org> References: <1455892594-2294-1-git-send-email-yao.qi@linaro.org> <1456495426-7520-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes disp-step-syscall.exp was added to test displaced stepping over syscall instructions, in which we set breakpoint on syscall instruction, and step over it. In fact, we can extend the test to non-displaced-stepping case. This patch wraps the test with displaced stepping on and off. Note that the indentation and format isn't adjusted here to make this patch easy to read. The following patch will fix the format separately. gdb/testsuite: 2016-02-26 Yao Qi * gdb.base/disp-step-syscall.exp: Don't invoke support_displaced_stepping. (disp_step_cross_syscall): Test with displaced stepping off and on if supported. --- gdb/testsuite/gdb.base/disp-step-syscall.exp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.base/disp-step-syscall.exp b/gdb/testsuite/gdb.base/disp-step-syscall.exp index a1af3b4..3cf436d 100644 --- a/gdb/testsuite/gdb.base/disp-step-syscall.exp +++ b/gdb/testsuite/gdb.base/disp-step-syscall.exp @@ -15,11 +15,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if { ![support_displaced_stepping] } { - unsupported "displaced stepping" - return -1 -} - set syscall_insn "" # Define the syscall instruction for each target. @@ -124,6 +119,11 @@ proc disp_step_cross_syscall { syscall } { return -1 } + foreach_with_prefix displaced {"off" "on"} { + if {$displaced == "on" && ![support_displaced_stepping]} { + continue + } + set ret [setup $syscall] set syscall_insn_addr [lindex $ret 0] @@ -149,7 +149,7 @@ proc disp_step_cross_syscall { syscall } { gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, .*" \ "continue to syscall insn $syscall" - gdb_test_no_output "set displaced-stepping on" + gdb_test_no_output "set displaced-stepping $displaced" # Check the address of next instruction of syscall. if {[gdb_test "stepi" "x/i .*=>.*" "single step over $syscall"] != 0} { @@ -164,6 +164,7 @@ proc disp_step_cross_syscall { syscall } { gdb_test "break marker" "Breakpoint.*at.* file .*${testfile}.c, line.*" gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker \\(\\) at.*" \ "continue to marker ($syscall)" + } } }