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

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