Blame SOURCES/gdb-rhbz1187581-power8-regs-2of7.patch

190f2a
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
190f2a
From: Jan Kratochvil <jan.kratochvil@redhat.com>
190f2a
Date: Thu, 9 Aug 2018 17:10:46 +0200
190f2a
Subject: gdb-rhbz1187581-power8-regs-2of7.patch
190f2a
190f2a
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
190f2a
190f2a
commit aa6f3694ce867884e43d1c0406c64df08ea24bd3
190f2a
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
190f2a
Date:   Mon Aug 6 16:24:55 2018 -0300
190f2a
190f2a
    Remove trailing '-' from the last QTDP action packet
190f2a
190f2a
    The has_more predicate in remote_target::download_tracepoint always
190f2a
    evaluates to true, so the last action packet will be sent with a
190f2a
    trailing '-'.  This patch changes the predicate to remove the last
190f2a
    trailing '-'.
190f2a
190f2a
    gdb/ChangeLog:
190f2a
    2018-08-06  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
190f2a
190f2a
            * remote.c (remote_target::download_tracepoint): Fix the has_more
190f2a
            predicate in the QTDP action list iteration.
190f2a
190f2a
diff --git a/gdb/remote.c b/gdb/remote.c
190f2a
--- a/gdb/remote.c
190f2a
+++ b/gdb/remote.c
190f2a
@@ -12899,7 +12899,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
190f2a
     {
190f2a
       QUIT;	/* Allow user to bail out with ^C.  */
190f2a
 
190f2a
-      bool has_more = (action_it != tdp_actions.end ()
190f2a
+      bool has_more = ((action_it + 1) != tdp_actions.end ()
190f2a
 		       || !stepping_actions.empty ());
190f2a
 
190f2a
       xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c",
190f2a
@@ -12918,7 +12918,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
190f2a
       QUIT;	/* Allow user to bail out with ^C.  */
190f2a
 
190f2a
       bool is_first = action_it == stepping_actions.begin ();
190f2a
-      bool has_more = action_it != stepping_actions.end ();
190f2a
+      bool has_more = (action_it + 1) != stepping_actions.end ();
190f2a
 
190f2a
       xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s",
190f2a
 		 b->number, addrbuf, /* address */