]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: add missing regcache_map_entry array null terminators in aarch64-linux-tdep.c
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 29 Nov 2023 16:35:23 +0000 (11:35 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 1 Dec 2023 16:20:34 +0000 (11:20 -0500)
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>
gdb/aarch64-linux-tdep.c

index cd99b33fed25afd3f09824d8d2d4b25aac637432..5be887a9c817afe448670d22bd7fb674de89db9d 100644 (file)
@@ -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