public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
To: gdb-patches@sourceware.org
Cc: uweigand@de.ibm.com, edjunior@gmail.com
Subject: [PATCH v3 02/12] [PowerPC] Don't zero-initialize vector register buffers
Date: Tue, 14 Aug 2018 20:41:00 -0000	[thread overview]
Message-ID: <20180814200609.19999-3-pedromfc@linux.ibm.com> (raw)
In-Reply-To: <20180814200609.19999-1-pedromfc@linux.ibm.com>

Now that linux-tdep.c already zero-initializes the buffer used for
generating core file notes, there is no need to do this in the linux
collect functions for the vector regset.  The memsets in gdbserver were
not useful to begin with.

gdb/ChangeLog:
YYYY-MM-DD  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

	* ppc-linux-tdep.c (ppc_linux_collect_vrregset): Remove.
	(ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): Replace
	ppc_linux_collect_vrregset by regcache_collect_regset.

gdb/gdbserver/ChangeLog:
2018-07-31  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

	* linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls.
---
 gdb/gdbserver/linux-ppc-low.c |  4 ----
 gdb/ppc-linux-tdep.c          | 22 ++--------------------
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 47428c1529..d1ab69fac9 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -495,13 +495,9 @@ ppc_fill_vrregset (struct regcache *regcache, void *buf)
   if (__BYTE_ORDER == __BIG_ENDIAN)
     vscr_offset = 12;
 
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave in
-     case they get displayed somewhere.  */
-  memset (&regset[32 * 16], 0, 16);
   collect_register_by_name (regcache, "vscr",
 			    &regset[32 * 16 + vscr_offset]);
 
-  memset (&regset[33 * 16], 0, 16);
   collect_register_by_name (regcache, "vrsave", &regset[33 * 16]);
 }
 
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 33a0b5a83b..b9bd775695 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -444,24 +444,6 @@ ppc_linux_collect_gregset (const struct regset *regset,
     }
 }
 
-static void
-ppc_linux_collect_vrregset (const struct regset *regset,
-			    const struct regcache *regcache,
-			    int regnum, void *buf, size_t len)
-{
-  gdb_byte *vrregs = (gdb_byte *) buf;
-
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave
-     in case they get displayed somewhere (e.g. in core files).  */
-  if (regnum == PPC_VSCR_REGNUM || regnum == -1)
-    memset (&vrregs[32 * 16], 0, 16);
-
-  if (regnum == PPC_VRSAVE_REGNUM || regnum == -1)
-    memset (&vrregs[33 * 16], 0, 16);
-
-  regcache_collect_regset (regset, regcache, regnum, buf, len);
-}
-
 /* Regset descriptions.  */
 static const struct ppc_reg_offsets ppc32_linux_reg_offsets =
   {
@@ -544,13 +526,13 @@ static const struct regcache_map_entry ppc32_be_linux_vrregmap[] =
 static const struct regset ppc32_le_linux_vrregset = {
   ppc32_le_linux_vrregmap,
   regcache_supply_regset,
-  ppc_linux_collect_vrregset
+  regcache_collect_regset
 };
 
 static const struct regset ppc32_be_linux_vrregset = {
   ppc32_be_linux_vrregmap,
   regcache_supply_regset,
-  ppc_linux_collect_vrregset
+  regcache_collect_regset
 };
 
 static const struct regcache_map_entry ppc32_linux_vsxregmap[] =
-- 
2.13.6

  parent reply	other threads:[~2018-08-14 20:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 20:07 [PATCH v3 00/12] GDB support for more powerpc registers on linux Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 06/12] [PowerPC] Fix indentation in arch/ppc-linux-common.c Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 01/12] Zero-initialize linux note sections Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 07/12] [PowerPC] Refactor have_ initializers in rs6000-tdep.c Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 11/12] [PowerPC] Reject tdescs with VSX and no FPU or Altivec Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 04/12] [PowerPC] Remove rs6000_pseudo_register_reggroup_p Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 03/12] Add decfloat registers to float reggroup Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 05/12] [PowerPC] Fix two if statements in gdb/ppc-linux-nat.c Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 12/12] [PowerPC] Add support for HTM registers Pedro Franco de Carvalho
2018-08-14 20:07 ` [PATCH v3 08/12] [PowerPC] Add support for PPR and DSCR Pedro Franco de Carvalho
2018-08-14 20:10 ` [PATCH v3 00/12] GDB support for more powerpc registers on linux Pedro Franco de Carvalho
2018-08-14 20:41 ` [PATCH v3 09/12] [PowerPC] Add support for TAR Pedro Franco de Carvalho
2018-08-14 20:41 ` Pedro Franco de Carvalho [this message]
2018-08-14 21:13 ` [PATCH v3 10/12] [PowerPC] Add support for EBB and PMU registers Pedro Franco de Carvalho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180814200609.19999-3-pedromfc@linux.ibm.com \
    --to=pedromfc@linux.ibm.com \
    --cc=edjunior@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).