public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: add missing regcache_map_entry array null terminators in aarch64-linux-tdep.c
@ 2023-12-01 16:21 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2023-12-01 16:21 UTC (permalink / raw)
  To: gdb-cvs

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

commit 9d8fc40eb0e611162844eb7b89f1c76875153fbe
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Wed Nov 29 11:35:23 2023 -0500

    gdb: add missing regcache_map_entry array null terminators in aarch64-linux-tdep.c
    
    Fix two spots in aarch64-linux-tdep.c that build regcache_map_entry
    arrays without a null terminator.  The null terminators are needed for
    regcache::transfer_regset and regcache_map_entry_size to work properly.
    
    Change-Id: I3224a314e1360b319438f32de8c81e70ab42e105
    Reviewed-By: John Baldwin <jhb@FreeBSD.org>
    Approved-By: Luis Machado <luis.machado@arm.com>

Diff:
---
 gdb/aarch64-linux-tdep.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index cd99b33fed2..5be887a9c81 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1497,7 +1497,9 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
       /* Create this on the fly in order to handle the ZA register size.  */
       const struct regcache_map_entry za_regmap[] =
 	{
-	  { 1, tdep->sme_za_regnum, (int) std::pow (sve_vl_from_vq (tdep->sme_svq), 2) }
+	  { 1, tdep->sme_za_regnum,
+	    (int) std::pow (sve_vl_from_vq (tdep->sme_svq), 2) },
+	  { 0 }
 	};
 
       const struct regset aarch64_linux_za_regset =
@@ -1518,7 +1520,8 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 	{
 	  const struct regcache_map_entry zt_regmap[] =
 	    {
-	      { 1, tdep->sme2_zt0_regnum, AARCH64_SME2_ZT0_SIZE }
+	      { 1, tdep->sme2_zt0_regnum, AARCH64_SME2_ZT0_SIZE },
+	      { 0 }
 	    };
 
 	  /* We set the register set size to REGSET_VARIABLE_SIZE here because

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01 16:21 [binutils-gdb] gdb: add missing regcache_map_entry array null terminators in aarch64-linux-tdep.c 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).