Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
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 21:03:00 -0000	[thread overview]
Message-ID: <20180727210318.2960-3-pedromfc@linux.ibm.com> (raw)
In-Reply-To: <20180727210318.2960-1-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  <pedromfc@linux.ibm.com>

	* 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 */
-- 
2.13.6


  parent reply	other threads:[~2018-07-27 21:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 21:03 [PATCH v2 0/6] Fix tracepoint register limitations Pedro Franco de Carvalho
2018-07-27 21:03 ` [PATCH v2 6/6] Allow larger regblock sizes when saving tracefiles Pedro Franco de Carvalho
2018-08-02 17:04   ` Ulrich Weigand
2018-07-27 21:03 ` [PATCH v2 5/6] Variable size for regs mask in collection list Pedro Franco de Carvalho
2018-08-02 17:01   ` Ulrich Weigand
2018-07-27 21:03 ` [PATCH v2 3/6] Use get_remote_packet_size in download_tracepoint Pedro Franco de Carvalho
2018-08-02 16:47   ` Ulrich Weigand
2018-08-03 21:41     ` Pedro Franco de Carvalho
2018-08-03 21:41     ` Pedro Franco de Carvalho
2018-08-06 12:40       ` Ulrich Weigand
     [not found]       ` <feb8623a-b89e-7519-22de-0d6ede3d5768@arm.com>
2018-08-08 10:33         ` [committed] Fix gdb/remote.c build failure Szabolcs Nagy
2018-08-08 12:25           ` Ulrich Weigand
2018-08-08 15:55         ` [PATCH v2 3/6] Use get_remote_packet_size in download_tracepoint Pedro Franco de Carvalho
2018-07-27 21:03 ` [PATCH v2 1/6] Fix indentation in remote_target::download_tracepoint Pedro Franco de Carvalho
2018-08-02 16:43   ` Ulrich Weigand
2018-07-27 21:03 ` [PATCH v2 4/6] Use remote register numbers in tracepoint mask Pedro Franco de Carvalho
2018-08-02 16:58   ` Ulrich Weigand
2018-08-03 22:09     ` Pedro Franco de Carvalho
2018-08-03 22:10     ` Pedro Franco de Carvalho
2018-08-06 12:42       ` Ulrich Weigand
2018-08-06 20:18         ` Pedro Franco de Carvalho
2018-07-27 21:03 ` Pedro Franco de Carvalho [this message]
2018-08-02 16:44   ` [PATCH v2 2/6] Remove trailing '-' from the last QTDP action packet Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180727210318.2960-3-pedromfc@linux.ibm.com \
    --to=pedromfc@linux.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox