From 41af43092ccc8030bb49cea324d85eecd5ae68a8 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Fri, 11 Nov 2016 04:28:40 +0000 Subject: Make the Error class constructor protected This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 llvm-svn: 286561 --- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index d18d3c16d2c9..6b4426b3989b 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -167,7 +167,7 @@ Error NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size, if (!hardware) return Error("not implemented"); if (m_state == eStateLaunching) - return Error(); + return Error::success(); Error error = RemoveWatchpoint(addr); if (error.Fail()) return error; @@ -176,17 +176,17 @@ Error NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size, if (wp_index == LLDB_INVALID_INDEX32) return Error("Setting hardware watchpoint failed."); m_watchpoint_index_map.insert({addr, wp_index}); - return Error(); + return Error::success(); } Error NativeThreadLinux::RemoveWatchpoint(lldb::addr_t addr) { auto wp = m_watchpoint_index_map.find(addr); if (wp == m_watchpoint_index_map.end()) - return Error(); + return Error::success(); uint32_t wp_index = wp->second; m_watchpoint_index_map.erase(wp); if (GetRegisterContext()->ClearHardwareWatchpoint(wp_index)) - return Error(); + return Error::success(); return Error("Clearing hardware watchpoint failed."); } -- cgit v1.2.3