Module Name:    src
Committed By:   rin
Date:           Wed Aug 23 10:37:46 UTC 2023

Modified Files:
        src/external/gpl3/gdb/dist/gdb: mips-netbsd-tdep.c

Log Message:
gdb/mips: Supply zero register as done for other OSes

With this change, gdb/mips 13 becomes working to some extent,
at least for mips{,n}64eb.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
    src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c:1.1.1.1	Sun Jul 30 22:44:54 2023
+++ src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c	Wed Aug 23 10:37:46 2023
@@ -95,6 +95,8 @@ mipsnbsd_supply_gregset (const struct re
       len -= MIPSNBSD_NUM_GREGS * regsize;
       mipsnbsd_supply_fpregset (regset, regcache, regnum, regs, len);
     }
+  if (regnum == -1 || regnum == MIPS_ZERO_REGNUM)
+    regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
 }
 
 /* NetBSD/mips register sets.  */
@@ -150,6 +152,8 @@ mipsnbsd_supply_reg (struct regcache *re
 	      (i, regs + (i * mips_isa_regsize (gdbarch)));
 	}
     }
+  if (regno == -1 || regno == MIPS_ZERO_REGNUM)
+    regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
 }
 
 void
@@ -277,8 +281,7 @@ mipsnbsd_get_longjmp_target (frame_info_
 static int
 mipsnbsd_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
 {
-  return (regno == MIPS_ZERO_REGNUM
-	  || regno == mips_regnum (gdbarch)->fp_implementation_revision);
+  return regno == mips_regnum (gdbarch)->fp_implementation_revision;
 }
 
 static int

Reply via email to