From patchwork Wed Jun 20 21:08:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pedromfc X-Patchwork-Id: 27954 Received: (qmail 21413 invoked by alias); 20 Jun 2018 21:10:35 -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 21400 invoked by uid 89); 20 Jun 2018 21:10:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Jun 2018 21:10:34 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KL5jvm077327 for ; Wed, 20 Jun 2018 17:10:32 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jqxhhg4wg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Jun 2018 17:10:32 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jun 2018 15:10:31 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 20 Jun 2018 15:10:31 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5KL9EkN8520052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 Jun 2018 14:09:14 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9620C605B; Wed, 20 Jun 2018 15:09:13 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACD8AC6059; Wed, 20 Jun 2018 15:09:13 -0600 (MDT) Received: from pedro.localdomain (unknown [9.18.235.95]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 20 Jun 2018 15:09:13 -0600 (MDT) Received: by pedro.localdomain (Postfix, from userid 1000) id F084F3C0426; Wed, 20 Jun 2018 18:09:10 -0300 (-03) From: Pedro Franco de Carvalho To: gdb-patches@sourceware.org Cc: uweigand@de.ibm.com Subject: [PATCH 2/4] Remove trailing '-' from the last QTDP action packet Date: Wed, 20 Jun 2018 18:08:53 -0300 In-Reply-To: <20180620210855.6385-1-pedromfc@linux.vnet.ibm.com> References: <20180620210855.6385-1-pedromfc@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18062021-0016-0000-0000-000008FD679C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009229; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01049879; UDB=6.00537992; IPR=6.00828851; MB=3.00021765; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 21:10:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062021-0017-0000-0000-00003F5AD89E Message-Id: <20180620210855.6385-3-pedromfc@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_09:, , signatures=0 X-IsSubscribed: yes 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 ff6280a47d..04dc67fdc0 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -12893,7 +12893,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", @@ -12912,7 +12912,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 */