+2018-05-22 Maciej W. Rozycki <macro@mips.com>
+
+ * mips-linux-nat.c (mips64_linux_register_addr): Return -1 if
+ the width of the requested register exceeds the width of the
+ `ptrace' data type.
+
2018-05-21 Tom Tromey <tom@tromey.com>
* printcmd.c (output_command): Remove.
+2018-05-22 Maciej W. Rozycki <macro@mips.com>
+
+ * linux-mips-low.c (mips_cannot_fetch_register): Return 1 if the
+ width of the requested register exceeds the width of the
+ `ptrace' data type.
+ (mips_cannot_store_register): Likewise.
+
2018-05-21 Maciej W. Rozycki <macro@mips.com>
* linux-mips-low.c (mips_fetch_register): New function. Update
tdesc = current_process ()->tdesc;
+ /* On n32 we can't access 64-bit registers via PTRACE_PEEKUSR. */
+ if (register_size (tdesc, regno) > sizeof (PTRACE_XFER_TYPE))
+ return 1;
+
if (find_regno (tdesc, "r0") == regno)
return 1;
tdesc = current_process ()->tdesc;
+ /* On n32 we can't access 64-bit registers via PTRACE_POKEUSR. */
+ if (register_size (tdesc, regno) > sizeof (PTRACE_XFER_TYPE))
+ return 1;
+
if (find_regno (tdesc, "r0") == regno)
return 1;
if (regno < 0 || regno >= gdbarch_num_regs (gdbarch))
error (_("Bogon register number %d."), regno);
+ /* On n32 we can't access 64-bit registers via PTRACE_PEEKUSR
+ or PTRACE_POKEUSR. */
+ if (register_size (gdbarch, regno) > sizeof (PTRACE_TYPE_RET))
+ return (CORE_ADDR) -1;
+
if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
regaddr = regno;
else if ((regno >= mips_regnum (gdbarch)->fp0)