Blame SOURCES/gdb-rhbz1187581-power8-regs-not-in-8.2-04of15.patch

7cb06c
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
7cb06c
From: Keith Seitz <keiths@redhat.com>
7cb06c
Date: Fri, 11 Jan 2019 17:02:13 -0500
7cb06c
Subject: gdb-rhbz1187581-power8-regs-not-in-8.2-04of15.patch
7cb06c
7cb06c
;; [PowerPC] Don't zero-initialize vector register buffers
7cb06c
;; Pedro Franco de Carvalho, RH BZ 1187581
7cb06c
7cb06c
[PowerPC] Don't zero-initialize vector register buffers
7cb06c
7cb06c
Now that linux-tdep.c already zero-initializes the buffer used for
7cb06c
generating core file notes, there is no need to do this in the linux
7cb06c
collect functions for the vector regset.  The memsets in gdbserver were
7cb06c
not useful to begin with.
7cb06c
7cb06c
gdb/ChangeLog:
7cb06c
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
7cb06c
7cb06c
    * ppc-linux-tdep.c (ppc_linux_collect_vrregset): Remove.
7cb06c
    (ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): Replace
7cb06c
    ppc_linux_collect_vrregset by regcache_collect_regset.
7cb06c
7cb06c
gdb/gdbserver/ChangeLog:
7cb06c
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
7cb06c
7cb06c
    * linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls.
7cb06c
7cb06c
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
7cb06c
--- a/gdb/gdbserver/linux-ppc-low.c
7cb06c
+++ b/gdb/gdbserver/linux-ppc-low.c
7cb06c
@@ -495,13 +495,9 @@ ppc_fill_vrregset (struct regcache *regcache, void *buf)
7cb06c
   if (__BYTE_ORDER == __BIG_ENDIAN)
7cb06c
     vscr_offset = 12;
7cb06c
 
7cb06c
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave in
7cb06c
-     case they get displayed somewhere.  */
7cb06c
-  memset (&regset[32 * 16], 0, 16);
7cb06c
   collect_register_by_name (regcache, "vscr",
7cb06c
 			    &regset[32 * 16 + vscr_offset]);
7cb06c
 
7cb06c
-  memset (&regset[33 * 16], 0, 16);
7cb06c
   collect_register_by_name (regcache, "vrsave", &regset[33 * 16]);
7cb06c
 }
7cb06c
 
7cb06c
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
7cb06c
--- a/gdb/ppc-linux-tdep.c
7cb06c
+++ b/gdb/ppc-linux-tdep.c
7cb06c
@@ -444,24 +444,6 @@ ppc_linux_collect_gregset (const struct regset *regset,
7cb06c
     }
7cb06c
 }
7cb06c
 
7cb06c
-static void
7cb06c
-ppc_linux_collect_vrregset (const struct regset *regset,
7cb06c
-			    const struct regcache *regcache,
7cb06c
-			    int regnum, void *buf, size_t len)
7cb06c
-{
7cb06c
-  gdb_byte *vrregs = (gdb_byte *) buf;
7cb06c
-
7cb06c
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave
7cb06c
-     in case they get displayed somewhere (e.g. in core files).  */
7cb06c
-  if (regnum == PPC_VSCR_REGNUM || regnum == -1)
7cb06c
-    memset (&vrregs[32 * 16], 0, 16);
7cb06c
-
7cb06c
-  if (regnum == PPC_VRSAVE_REGNUM || regnum == -1)
7cb06c
-    memset (&vrregs[33 * 16], 0, 16);
7cb06c
-
7cb06c
-  regcache_collect_regset (regset, regcache, regnum, buf, len);
7cb06c
-}
7cb06c
-
7cb06c
 /* Regset descriptions.  */
7cb06c
 static const struct ppc_reg_offsets ppc32_linux_reg_offsets =
7cb06c
   {
7cb06c
@@ -544,13 +526,13 @@ static const struct regcache_map_entry ppc32_be_linux_vrregmap[] =
7cb06c
 static const struct regset ppc32_le_linux_vrregset = {
7cb06c
   ppc32_le_linux_vrregmap,
7cb06c
   regcache_supply_regset,
7cb06c
-  ppc_linux_collect_vrregset
7cb06c
+  regcache_collect_regset
7cb06c
 };
7cb06c
 
7cb06c
 static const struct regset ppc32_be_linux_vrregset = {
7cb06c
   ppc32_be_linux_vrregmap,
7cb06c
   regcache_supply_regset,
7cb06c
-  ppc_linux_collect_vrregset
7cb06c
+  regcache_collect_regset
7cb06c
 };
7cb06c
 
7cb06c
 static const struct regcache_map_entry ppc32_linux_vsxregmap[] =