On 3/25/25 08:40, Philippe Mathieu-Daudé wrote:
Replace the single ldtul_p() call by a generic ldn_p() one.
No logical change.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  target/mips/gdbstub.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/mips/gdbstub.c b/target/mips/gdbstub.c
index 169d47416a6..b9fc667373e 100644
--- a/target/mips/gdbstub.c
+++ b/target/mips/gdbstub.c
@@ -79,12 +79,13 @@ int mips_cpu_gdb_write_register(CPUState *cs, uint8_t 
*mem_buf, int n)
  {
      CPUMIPSState *env = cpu_env(cs);
      target_ulong tmp;
+    size_t regsize = sizeof(tmp);
- tmp = ldtul_p(mem_buf);
+    tmp = ldn_p(mem_buf, regsize);
if (n < 32) {
          env->active_tc.gpr[n] = tmp;
-        return sizeof(target_ulong);
+        return regsize;
      }
      if (env->CP0_Config1 & (1 << CP0C1_FP) && n >= 38 && n < 72) {
          switch (n) {
@@ -104,7 +105,7 @@ int mips_cpu_gdb_write_register(CPUState *cs, uint8_t 
*mem_buf, int n)
              }
              break;
          }
-        return sizeof(target_ulong);
+        return regsize;
      }
      switch (n) {
      case 32:
@@ -144,5 +145,5 @@ int mips_cpu_gdb_write_register(CPUState *cs, uint8_t 
*mem_buf, int n)
          break;
      }
- return sizeof(target_ulong);
+    return regsize;
  }

Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>

Reply via email to