From patchwork Fri Jul 27 21:03:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Franco de Carvalho X-Patchwork-Id: 28659 Received: (qmail 116886 invoked by alias); 27 Jul 2018 21:03:46 -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 116818 invoked by uid 89); 27 Jul 2018 21:03:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jul 2018 21:03:45 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6RKsRl6119641 for ; Fri, 27 Jul 2018 17:03:44 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kg78cgduy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Jul 2018 17:03:43 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jul 2018 15:03:42 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 27 Jul 2018 15:03:41 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6RL3chL20054286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 27 Jul 2018 14:03:38 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6C33C6057; Fri, 27 Jul 2018 15:03:38 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68D3CC6055; Fri, 27 Jul 2018 15:03:38 -0600 (MDT) Received: from pedro.localdomain (unknown [9.85.199.57]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 27 Jul 2018 15:03:38 -0600 (MDT) Received: by pedro.localdomain (Postfix, from userid 1000) id ABDE73C0401; Fri, 27 Jul 2018 18:03:35 -0300 (-03) From: Pedro Franco de Carvalho To: gdb-patches@sourceware.org Cc: uweigand@de.ibm.com Subject: [PATCH v2 2/6] Remove trailing '-' from the last QTDP action packet Date: Fri, 27 Jul 2018 18:03:14 -0300 In-Reply-To: <20180727210318.2960-1-pedromfc@linux.ibm.com> References: <20180727210318.2960-1-pedromfc@linux.ibm.com> x-cbid: 18072721-8235-0000-0000-00000DD97BCE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009440; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01067028; UDB=6.00548259; IPR=6.00844894; MB=3.00022359; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-27 21:03:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072721-8236-0000-0000-0000420A192F Message-Id: <20180727210318.2960-3-pedromfc@linux.ibm.com> The has_more predicate in remote_target::download_tracepoint always evaluates to true, so the last action packet will be sent with a trailing '-'. This patch changes the predicate to remove the last trailing '-'. gdb/ChangeLog: YYYY-MM-DD Pedro Franco de Carvalho * remote.c (remote_target::download_tracepoint): Fix the has_more predicate in the QTDP action list iteration. --- gdb/remote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 088efaad12..e3180923ee 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -12932,7 +12932,7 @@ remote_target::download_tracepoint (struct bp_location *loc) { QUIT; /* Allow user to bail out with ^C. */ - bool has_more = (action_it != tdp_actions.end () + bool has_more = ((action_it + 1) != tdp_actions.end () || !stepping_actions.empty ()); xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c", @@ -12951,7 +12951,7 @@ remote_target::download_tracepoint (struct bp_location *loc) QUIT; /* Allow user to bail out with ^C. */ bool is_first = action_it == stepping_actions.begin (); - bool has_more = action_it != stepping_actions.end (); + bool has_more = (action_it + 1) != stepping_actions.end (); xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", b->number, addrbuf, /* address */