diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:47:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:47:58 +0000 |
commit | b76161e41bc2c07cd47f9c61f875d1be95e26d10 (patch) | |
tree | d03c19ce10dec6419f97df1d4dac9d47eb88982f /source/Plugins/Process/Linux/NativeThreadLinux.cpp | |
parent | 8b4000f13b303cc154136abc74c55670673e2a96 (diff) |
Notes
Diffstat (limited to 'source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r-- | source/Plugins/Process/Linux/NativeThreadLinux.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/source/Plugins/Process/Linux/NativeThreadLinux.cpp index 04b6fe6d71e9c..b1d13668f327d 100644 --- a/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -160,39 +160,40 @@ NativeRegisterContextSP NativeThreadLinux::GetRegisterContext() { return m_reg_context_sp; } -Error NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size, - uint32_t watch_flags, bool hardware) { +Status NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size, + uint32_t watch_flags, bool hardware) { if (!hardware) - return Error("not implemented"); + return Status("not implemented"); if (m_state == eStateLaunching) - return Error(); - Error error = RemoveWatchpoint(addr); + return Status(); + Status error = RemoveWatchpoint(addr); if (error.Fail()) return error; NativeRegisterContextSP reg_ctx = GetRegisterContext(); uint32_t wp_index = reg_ctx->SetHardwareWatchpoint(addr, size, watch_flags); if (wp_index == LLDB_INVALID_INDEX32) - return Error("Setting hardware watchpoint failed."); + return Status("Setting hardware watchpoint failed."); m_watchpoint_index_map.insert({addr, wp_index}); - return Error(); + return Status(); } -Error NativeThreadLinux::RemoveWatchpoint(lldb::addr_t addr) { +Status NativeThreadLinux::RemoveWatchpoint(lldb::addr_t addr) { auto wp = m_watchpoint_index_map.find(addr); if (wp == m_watchpoint_index_map.end()) - return Error(); + return Status(); uint32_t wp_index = wp->second; m_watchpoint_index_map.erase(wp); if (GetRegisterContext()->ClearHardwareWatchpoint(wp_index)) - return Error(); - return Error("Clearing hardware watchpoint failed."); + return Status(); + return Status("Clearing hardware watchpoint failed."); } -Error NativeThreadLinux::SetHardwareBreakpoint(lldb::addr_t addr, size_t size) { +Status NativeThreadLinux::SetHardwareBreakpoint(lldb::addr_t addr, + size_t size) { if (m_state == eStateLaunching) - return Error(); + return Status(); - Error error = RemoveHardwareBreakpoint(addr); + Status error = RemoveHardwareBreakpoint(addr); if (error.Fail()) return error; @@ -200,27 +201,27 @@ Error NativeThreadLinux::SetHardwareBreakpoint(lldb::addr_t addr, size_t size) { uint32_t bp_index = reg_ctx->SetHardwareBreakpoint(addr, size); if (bp_index == LLDB_INVALID_INDEX32) - return Error("Setting hardware breakpoint failed."); + return Status("Setting hardware breakpoint failed."); m_hw_break_index_map.insert({addr, bp_index}); - return Error(); + return Status(); } -Error NativeThreadLinux::RemoveHardwareBreakpoint(lldb::addr_t addr) { +Status NativeThreadLinux::RemoveHardwareBreakpoint(lldb::addr_t addr) { auto bp = m_hw_break_index_map.find(addr); if (bp == m_hw_break_index_map.end()) - return Error(); + return Status(); uint32_t bp_index = bp->second; if (GetRegisterContext()->ClearHardwareBreakpoint(bp_index)) { m_hw_break_index_map.erase(bp); - return Error(); + return Status(); } - return Error("Clearing hardware breakpoint failed."); + return Status("Clearing hardware breakpoint failed."); } -Error NativeThreadLinux::Resume(uint32_t signo) { +Status NativeThreadLinux::Resume(uint32_t signo) { const StateType new_state = StateType::eStateRunning; MaybeLogStateChange(new_state); m_state = new_state; @@ -262,7 +263,7 @@ Error NativeThreadLinux::Resume(uint32_t signo) { reinterpret_cast<void *>(data)); } -Error NativeThreadLinux::SingleStep(uint32_t signo) { +Status NativeThreadLinux::SingleStep(uint32_t signo) { const StateType new_state = StateType::eStateStepping; MaybeLogStateChange(new_state); m_state = new_state; @@ -422,7 +423,7 @@ void NativeThreadLinux::SetExited() { m_stop_info.reason = StopReason::eStopReasonThreadExiting; } -Error NativeThreadLinux::RequestStop() { +Status NativeThreadLinux::RequestStop() { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); NativeProcessLinux &process = GetProcess(); @@ -435,7 +436,7 @@ Error NativeThreadLinux::RequestStop() { ", tid: %" PRIu64 ")", __FUNCTION__, pid, tid); - Error err; + Status err; errno = 0; if (::tgkill(pid, tid, SIGSTOP) != 0) { err.SetErrorToErrno(); |