[PATCH 5/7] [gdb/tdep] Use raw_supply_zeroed for NIOS r0 reg

Tom de Vries tdevries@suse.de
Mon Nov 4 13:42:54 GMT 2024


Use reg_buffer::raw_supply_zeroed for NIOS register r0.

Tested by rebuilding on x86_64-linux.
---
 gdb/nios2-linux-tdep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index bd5f6cfe3f6..085e13ce126 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -61,7 +61,6 @@ nios2_supply_gregset (const struct regset *regset,
 {
   const gdb_byte *gregs = (const gdb_byte *) gregs_buf;
   int regno;
-  static const gdb_byte zero_buf[4] = {0, 0, 0, 0};
 
   for (regno = NIOS2_Z_REGNUM; regno <= NIOS2_MPUACC_REGNUM; regno++)
     if (regnum == -1 || regnum == regno)
@@ -69,7 +68,7 @@ nios2_supply_gregset (const struct regset *regset,
 	if (reg_offsets[regno] != -1)
 	  regcache->raw_supply (regno, gregs + 4 * reg_offsets[regno]);
 	else
-	  regcache->raw_supply (regno, zero_buf);
+	  regcache->raw_supply_zeroed (regno);
       }
 }
 
-- 
2.35.3



More information about the Gdb-patches mailing list