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

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