Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp @@ -22,7 +22,7 @@ NativeRegisterContextLinux::NativeRegisterContextLinux(NativeThreadProtocol &native_thread, uint32_t concrete_frame_idx, RegisterInfoInterface *reg_info_interface_p) : - NativeRegisterContextRegisterInfo(native_thread, concrete_frame_idx, reg_info_interface_p) + NativeRegisterContextRegisterInfo(native_thread, concrete_frame_idx, reg_info_interface_p) {} lldb::ByteOrder @@ -48,7 +48,7 @@ { const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(reg_index); if (!reg_info) - return Error("register %" PRIu32 " not found", reg_index); + return Error("register %" PRIu32 " not found", reg_index); NativeProcessProtocolSP process_sp(m_thread.GetProcess()); if (!process_sp) @@ -70,7 +70,7 @@ const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg_index); if (reg_info->invalidate_regs && (reg_info->invalidate_regs[0] != LLDB_INVALID_REGNUM)) { - Error error; + Error error; RegisterValue full_value; uint32_t full_reg = reg_info->invalidate_regs[0]; @@ -110,7 +110,7 @@ NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); if (!process_sp) - return Error("NativeProcessProtocol is NULL"); + return Error("NativeProcessProtocol is NULL"); const RegisterInfo *const register_to_write_info_p = GetRegisterInfoAtIndex (reg_to_write); assert (register_to_write_info_p && "register to write does not have valid RegisterInfo"); @@ -126,13 +126,13 @@ Error NativeRegisterContextLinux::ReadGPR() { - NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); if (!process_sp) return Error("NativeProcessProtocol is NULL"); void* buf = GetGPRBuffer(); if (!buf) - return Error("GPR buffer is NULL"); + return Error("GPR buffer is NULL"); size_t buf_size = GetGPRSize(); NativeProcessLinux* process_p = static_cast(process_sp.get()); @@ -142,13 +142,13 @@ Error NativeRegisterContextLinux::WriteGPR() { - NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); if (!process_sp) return Error("NativeProcessProtocol is NULL"); void* buf = GetGPRBuffer(); if (!buf) - return Error("GPR buffer is NULL"); + return Error("GPR buffer is NULL"); size_t buf_size = GetGPRSize(); NativeProcessLinux* process_p = static_cast(process_sp.get()); @@ -158,13 +158,13 @@ Error NativeRegisterContextLinux::ReadFPR() { - NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); if (!process_sp) return Error("NativeProcessProtocol is NULL"); void* buf = GetFPRBuffer(); if (!buf) - return Error("GPR buffer is NULL"); + return Error("GPR buffer is NULL"); size_t buf_size = GetFPRSize(); NativeProcessLinux* process_p = static_cast(process_sp.get()); @@ -174,13 +174,13 @@ Error NativeRegisterContextLinux::WriteFPR() { - NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); if (!process_sp) return Error("NativeProcessProtocol is NULL"); void* buf = GetFPRBuffer(); if (!buf) - return Error("GPR buffer is NULL"); + return Error("GPR buffer is NULL"); size_t buf_size = GetFPRSize(); NativeProcessLinux* process_p = static_cast(process_sp.get()); @@ -228,10 +228,11 @@ PTRACE_PEEKUSER, m_thread.GetID(), reinterpret_cast(offset), nullptr, 0, &data); if (error.Success()) - value = static_cast(data); + // First cast to an unsigned of the same size to avoid sign extension. + value.SetUInt64(static_cast(data)); if (log) - log->Printf ("NativeRegisterContextLinux::%s() reg %s: 0x%" PRIx64, __FUNCTION__, reg_name, data); + log->Printf ("NativeRegisterContextLinux::%s() reg %s: 0x%lx", __FUNCTION__, reg_name, data); return error; }