diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-11 04:28:40 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-11 04:28:40 +0000 |
commit | 41af43092ccc8030bb49cea324d85eecd5ae68a8 (patch) | |
tree | f30038673dd27f2d4785068fffd510abe4fb23d7 /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | |
parent | e8e98dcb74cd6d297c31c023bfacdf7f28cdaabc (diff) | |
download | llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.zip llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.tar.gz llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.tar.bz2 |
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
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index d18d3c1..6b4426b 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."); } |