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

4c2ad1
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
4c2ad1
From: Jan Kratochvil <jan.kratochvil@redhat.com>
4c2ad1
Date: Thu, 9 Aug 2018 17:18:49 +0200
4c2ad1
Subject: gdb-rhbz1187581-power8-regs-7of7.patch
4c2ad1
4c2ad1
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
4c2ad1
4c2ad1
commit a7f25a84f4cc1df5248c46346337f19a2a66af5a
4c2ad1
Author: Simon Marchi <simon.marchi@ericsson.com>
4c2ad1
Date:   Mon Aug 6 16:54:47 2018 -0400
4c2ad1
4c2ad1
    Fix compilation failure in remote.c
4c2ad1
4c2ad1
    A recent patch introduced a few of these:
4c2ad1
4c2ad1
    /home/emaisin/src/binutils-gdb/gdb/remote.c:12862:19: error: format not a string literal and no format arguments [-Werror=format-security]
4c2ad1
         error (err_msg);
4c2ad1
                       ^
4c2ad1
4c2ad1
    Fix them by replacing the call to error with
4c2ad1
4c2ad1
      error ("%s", err_msg);
4c2ad1
4c2ad1
    gdb/ChangeLog:
4c2ad1
4c2ad1
            * remote.c (remote_target::download_tracepoint): Fix format
4c2ad1
            string errors.
4c2ad1
4c2ad1
+2018-08-06  Simon Marchi  <simon.marchi@ericsson.com>
4c2ad1
+
4c2ad1
+	* remote.c (remote_target::download_tracepoint): Fix format
4c2ad1
+	string errors.
4c2ad1
+
4c2ad1
 2018-08-06  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
4c2ad1
4c2ad1
 	* tracefile.c: Include common/byte-vector.h.
4c2ad1
4c2ad1
diff --git a/gdb/remote.c b/gdb/remote.c
4c2ad1
--- a/gdb/remote.c
4c2ad1
+++ b/gdb/remote.c
4c2ad1
@@ -12826,7 +12826,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 		  t->step_count, t->pass_count);
4c2ad1
 
4c2ad1
   if (ret < 0 || ret >= buf.size ())
4c2ad1
-    error (err_msg);
4c2ad1
+    error ("%s", err_msg);
4c2ad1
 
4c2ad1
   /* Fast tracepoints are mostly handled by the target, but we can
4c2ad1
      tell the target how big of an instruction block should be moved
4c2ad1
@@ -12846,7 +12846,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 			      gdb_insn_length (loc->gdbarch, tpaddr));
4c2ad1
 
4c2ad1
 	      if (ret < 0 || ret >= size_left)
4c2ad1
-		error (err_msg);
4c2ad1
+		error ("%s", err_msg);
4c2ad1
 	    }
4c2ad1
 	  else
4c2ad1
 	    /* If it passed validation at definition but fails now,
4c2ad1
@@ -12877,7 +12877,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 			      size_left, ":S");
4c2ad1
 
4c2ad1
 	      if (ret < 0 || ret >= size_left)
4c2ad1
-		error (err_msg);
4c2ad1
+		error ("%s", err_msg);
4c2ad1
 	    }
4c2ad1
 	  else
4c2ad1
 	    error (_("Static tracepoint not valid during download"));
4c2ad1
@@ -12905,14 +12905,14 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 			  size_left, ":X%x,", aexpr->len);
4c2ad1
 
4c2ad1
 	  if (ret < 0 || ret >= size_left)
4c2ad1
-	    error (err_msg);
4c2ad1
+	    error ("%s", err_msg);
4c2ad1
 
4c2ad1
 	  size_left = buf.size () - strlen (buf.data ());
4c2ad1
 
4c2ad1
 	  /* Two bytes to encode each aexpr byte, plus the terminating
4c2ad1
 	     null byte.  */
4c2ad1
 	  if (aexpr->len * 2 + 1 > size_left)
4c2ad1
-	    error (err_msg);
4c2ad1
+	    error ("%s", err_msg);
4c2ad1
 
4c2ad1
 	  pkt = buf.data () + strlen (buf.data ());
4c2ad1
 
4c2ad1
@@ -12933,7 +12933,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 		      size_left, "-");
4c2ad1
 
4c2ad1
       if (ret < 0 || ret >= size_left)
4c2ad1
-	error (err_msg);
4c2ad1
+	error ("%s", err_msg);
4c2ad1
     }
4c2ad1
 
4c2ad1
   putpkt (buf.data ());
4c2ad1
@@ -12956,7 +12956,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 		      has_more ? '-' : 0);
4c2ad1
 
4c2ad1
       if (ret < 0 || ret >= buf.size ())
4c2ad1
-	error (err_msg);
4c2ad1
+	error ("%s", err_msg);
4c2ad1
 
4c2ad1
       putpkt (buf.data ());
4c2ad1
       remote_get_noisy_reply ();
4c2ad1
@@ -12979,7 +12979,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 		      has_more ? "-" : "");
4c2ad1
 
4c2ad1
       if (ret < 0 || ret >= buf.size ())
4c2ad1
-	error (err_msg);
4c2ad1
+	error ("%s", err_msg);
4c2ad1
 
4c2ad1
       putpkt (buf.data ());
4c2ad1
       remote_get_noisy_reply ();
4c2ad1
@@ -12994,7 +12994,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 	  ret = snprintf (buf.data (), buf.size (), "QTDPsrc:");
4c2ad1
 
4c2ad1
 	  if (ret < 0 || ret >= buf.size ())
4c2ad1
-	    error (err_msg);
4c2ad1
+	    error ("%s", err_msg);
4c2ad1
 
4c2ad1
 	  encode_source_string (b->number, loc->address, "at",
4c2ad1
 				event_location_to_string (b->location.get ()),
4c2ad1
@@ -13010,7 +13010,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
4c2ad1
 	  ret = snprintf (buf.data (), buf.size (), "QTDPsrc:");
4c2ad1
 
4c2ad1
 	  if (ret < 0 || ret >= buf.size ())
4c2ad1
-	    error (err_msg);
4c2ad1
+	    error ("%s", err_msg);
4c2ad1
 
4c2ad1
 	  encode_source_string (b->number, loc->address,
4c2ad1
 				"cond", b->cond_string,