public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: add missing raw register read in aarch64_sme_pseudo_register_write
@ 2023-12-14 16:22 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2023-12-14 16:22 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=06f02beb8fae22b079ed7c5360c17b3670cbb291

commit 06f02beb8fae22b079ed7c5360c17b3670cbb291
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Fri Dec 1 11:27:33 2023 -0500

    gdb: add missing raw register read in aarch64_sme_pseudo_register_write
    
    It seems like the intention here is to read the contents of the ZA
    register and only write part of it.  However, there's no actual read of
    the ZA register, so it looks like we'll write uninitialized bytes to the
    target, for the portion of the raw register where we don't write the
    pseudo register.  Add a call to raw_read to fix this.
    
    I don't know how to test this though.
    
    Change-Id: I7548240bd4324f6a3b729a1ebf7502fae5a46e9e
    Reviewed-By: John Baldwin <jhb@FreeBSD.org>
    Approved-by: Luis Machado <luis.machado@arm.com>

Diff:
---
 gdb/aarch64-tdep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 5c3b824ed0a..e3658c2c8e1 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -3337,6 +3337,7 @@ aarch64_sme_pseudo_register_write (struct gdbarch *gdbarch,
   /* Fetch the contents of ZA.  */
   size_t svl = sve_vl_from_vq (tdep->sme_svq);
   gdb::byte_vector za (std::pow (svl, 2));
+  regcache->raw_read (tdep->sme_za_regnum, za);
 
   /* Copy the requested data.  */
   for (int chunks = 0; chunks < offsets.chunks; chunks++)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-14 16:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-14 16:22 [binutils-gdb] gdb: add missing raw register read in aarch64_sme_pseudo_register_write Simon Marchi

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).