From patchwork Wed Jul 1 13:58:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7454 Received: (qmail 90927 invoked by alias); 1 Jul 2015 13:59:02 -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 90850 invoked by uid 89); 1 Jul 2015 13:59:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 01 Jul 2015 13:58:54 +0000 Received: by paceq1 with SMTP id eq1so23600994pac.3 for ; Wed, 01 Jul 2015 06:58:52 -0700 (PDT) X-Received: by 10.66.142.42 with SMTP id rt10mr54720579pab.142.1435759131897; Wed, 01 Jul 2015 06:58:51 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id sc7sm2417503pbb.85.2015.07.01.06.58.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jul 2015 06:58:51 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 10/11] Reply s and S vCont actions if target supports hardware single step Date: Wed, 1 Jul 2015 14:58:30 +0100 Message-Id: <1435759111-22856-11-git-send-email-yao.qi@linaro.org> In-Reply-To: <1435759111-22856-1-git-send-email-yao.qi@linaro.org> References: <1435759111-22856-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Nowadays, GDBserver reports vCont s and S actions are supported unconditionally in vCont? reply, which isn't accurate. This patch is to teach GDBserver to tell GDB that whether GDBserver can do hardware single step by reporting s and S in the vCont? reply, if GDBserver knows it supports hardware single step. gdb/gdbserver: 2015-06-30 Yao Qi * server.c (handle_v_requests): Append ";s;S" to own_buf if target_supports_hardware_single_step returns true. --- gdb/gdbserver/server.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 858fbe5..e5a8f06 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -2766,7 +2766,14 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len) if (startswith (own_buf, "vCont?")) { - strcpy (own_buf, "vCont;c;C;s;S;t"); + strcpy (own_buf, "vCont;c;C;t"); + if (target_supports_hardware_single_step ()) + { + /* Only return s;S if target supports hardware single + step. */ + own_buf = own_buf + strlen (own_buf); + strcpy (own_buf, ";s;S"); + } if (target_supports_range_stepping ()) { own_buf = own_buf + strlen (own_buf);