diff options
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 917f1351563..50de01ca774 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -877,13 +877,19 @@ NativeRegisterContextLinux_mips64::IsWatchpointHit (uint32_t wp_index, bool &is_ // reading the current state of watch regs struct pt_watch_regs watch_readback; - Error error = DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(&watch_readback)); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessLinux *const process_p = static_cast<NativeProcessLinux*> (process_sp.get ()); + Error error = process_p->DoOperation([&] { + return DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(&watch_readback)); + }); if (GetWatchHi (&watch_readback, wp_index) & (IRW)) { // clear hit flag in watchhi SetWatchHi (&watch_readback, wp_index, (GetWatchHi (&watch_readback, wp_index) & ~(IRW))); - DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(&watch_readback)); + process_p->DoOperation([&] { + return DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(&watch_readback)); + }); is_hit = true; return error; @@ -924,7 +930,11 @@ NativeRegisterContextLinux_mips64::ClearHardwareWatchpoint(uint32_t wp_index) struct pt_watch_regs regs; // First reading the current state of watch regs - DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void*>(®s)); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessLinux *const process_p = static_cast<NativeProcessLinux*> (process_sp.get ()); + process_p->DoOperation([&] { + return DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void*>(®s)); + }); if (regs.style == pt_watch_style_mips32) { @@ -939,7 +949,9 @@ NativeRegisterContextLinux_mips64::ClearHardwareWatchpoint(uint32_t wp_index) regs.mips64.watch_masks[wp_index] = default_watch_regs.mips64.watch_masks[wp_index]; } - Error error = DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + Error error = process_p->DoOperation([&] { + return DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + }); if(!error.Fail()) { hw_addr_map[wp_index] = LLDB_INVALID_ADDRESS; @@ -951,7 +963,11 @@ NativeRegisterContextLinux_mips64::ClearHardwareWatchpoint(uint32_t wp_index) Error NativeRegisterContextLinux_mips64::ClearAllHardwareWatchpoints() { - return DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(&default_watch_regs)); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessLinux *const process_p = static_cast<NativeProcessLinux *> (process_sp.get ()); + return process_p->DoOperation([&] { + return DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(&default_watch_regs)); + }); } Error @@ -970,7 +986,11 @@ NativeRegisterContextLinux_mips64::SetHardwareWatchpoint ( struct pt_watch_regs regs; // First reading the current state of watch regs - DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + NativeProcessLinux *const process_p = static_cast<NativeProcessLinux*> (process_sp.get ()); + process_p->DoOperation([&] { + return DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + }); // Try if a new watch point fits in this state int index = GetVacantWatchIndex (®s, addr, size, watch_flags, NumSupportedHardwareWatchpoints()); @@ -981,7 +1001,9 @@ NativeRegisterContextLinux_mips64::SetHardwareWatchpoint ( // It fits, so we go ahead with updating the state of watch regs - DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + process_p->DoOperation([&] { + return DoWriteWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + }); // Storing exact address hw_addr_map[index] = addr; @@ -1005,7 +1027,17 @@ NativeRegisterContextLinux_mips64::NumSupportedHardwareWatchpoints () static int num_valid = 0; if (!num_valid) { - DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + NativeProcessProtocolSP process_sp (m_thread.GetProcess ()); + if (!process_sp) + { + printf ("NativeProcessProtocol is NULL"); + return 0; + } + + NativeProcessLinux *const process_p = static_cast<NativeProcessLinux*> (process_sp.get ()); + process_p->DoOperation([&] { + return DoReadWatchPointRegisterValue(m_thread.GetID(), static_cast<void *>(®s)); + }); default_watch_regs = regs; // Keeping default watch regs values for future use switch (regs.style) { |

