Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp =================================================================== --- source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -1388,7 +1388,7 @@ { lldb_private::ArchSpec arch; if (m_thread.GetProcess()->GetArchitecture(arch)) - value.SetBytes((void *)(((unsigned char *)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips)), arch.GetAddressByteSize(), arch.GetByteOrder()); + value.SetBytes((void *)(((unsigned char *)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips)), 4 + (!(arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32) * 4), arch.GetByteOrder()); else error.SetErrorString("failed to get architecture"); } @@ -1404,8 +1404,14 @@ Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); if (error.Success()) { - ::memcpy((void *)(((unsigned char *)(®s)) + offset), value.GetBytes(), 8); - error = NativeProcessLinux::PtraceWrapper(PTRACE_SETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); + lldb_private::ArchSpec arch; + if (m_thread.GetProcess()->GetArchitecture(arch)) + { + ::memcpy((void *)(((unsigned char *)(®s)) + offset), value.GetBytes(), 4 + (!(arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32) * 4)); + error = NativeProcessLinux::PtraceWrapper(PTRACE_SETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); + } + else + error.SetErrorString("failed to get architecture"); } return error; }