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
diff --git a/lldb/source/Host/common/NativeBreakpoint.cpp b/lldb/source/Host/common/NativeBreakpoint.cpp
index d61a2f5..a2cc048 100644
--- a/lldb/source/Host/common/NativeBreakpoint.cpp
+++ b/lldb/source/Host/common/NativeBreakpoint.cpp
@@ -53,7 +53,7 @@
log->Printf("NativeBreakpoint::%s addr = 0x%" PRIx64
" already enabled, ignoring.",
__FUNCTION__, m_addr);
- return Error();
+ return Error::success();
}
// Log and enable.
@@ -85,7 +85,7 @@
log->Printf("NativeBreakpoint::%s addr = 0x%" PRIx64
" already disabled, ignoring.",
__FUNCTION__, m_addr);
- return Error();
+ return Error::success();
}
// Log and disable.
diff --git a/lldb/source/Host/common/NativeBreakpointList.cpp b/lldb/source/Host/common/NativeBreakpointList.cpp
index df5bce8..58e1c3e 100644
--- a/lldb/source/Host/common/NativeBreakpointList.cpp
+++ b/lldb/source/Host/common/NativeBreakpointList.cpp
@@ -40,7 +40,7 @@
__FUNCTION__, addr);
iter->second->AddRef();
- return Error();
+ return Error::success();
}
// Create a new breakpoint using the given create func.
@@ -205,7 +205,7 @@
// Disable it.
breakpoint_sp = iter->second;
- return Error();
+ return Error::success();
}
Error NativeBreakpointList::RemoveTrapsFromBuffer(lldb::addr_t addr, void *buf,
@@ -225,5 +225,5 @@
auto opcode_size = software_bp_sp->m_opcode_size;
::memcpy(opcode_addr, saved_opcodes, opcode_size);
}
- return Error();
+ return Error::success();
}
diff --git a/lldb/source/Host/common/NativeProcessProtocol.cpp b/lldb/source/Host/common/NativeProcessProtocol.cpp
index d77b8b2..a22d7f8 100644
--- a/lldb/source/Host/common/NativeProcessProtocol.cpp
+++ b/lldb/source/Host/common/NativeProcessProtocol.cpp
@@ -405,7 +405,7 @@
arch = module_specs.GetModuleSpecRefAtIndex(0).GetArchitecture();
if (arch.IsValid())
- return Error();
+ return Error::success();
else
return Error("failed to retrieve a valid architecture from the exe module");
}
diff --git a/lldb/source/Host/common/NativeWatchpointList.cpp b/lldb/source/Host/common/NativeWatchpointList.cpp
index 5948adf..be9d2eb 100644
--- a/lldb/source/Host/common/NativeWatchpointList.cpp
+++ b/lldb/source/Host/common/NativeWatchpointList.cpp
@@ -17,12 +17,12 @@
Error NativeWatchpointList::Add(addr_t addr, size_t size, uint32_t watch_flags,
bool hardware) {
m_watchpoints[addr] = {addr, size, watch_flags, hardware};
- return Error();
+ return Error::success();
}
Error NativeWatchpointList::Remove(addr_t addr) {
m_watchpoints.erase(addr);
- return Error();
+ return Error::success();
}
const NativeWatchpointList::WatchpointMap &
diff --git a/lldb/source/Host/common/SoftwareBreakpoint.cpp b/lldb/source/Host/common/SoftwareBreakpoint.cpp
index 3d57b7d..6cb8126 100644
--- a/lldb/source/Host/common/SoftwareBreakpoint.cpp
+++ b/lldb/source/Host/common/SoftwareBreakpoint.cpp
@@ -103,7 +103,7 @@
// breakpoint.
breakpoint_sp.reset(new SoftwareBreakpoint(process, addr, saved_opcode_bytes,
bp_opcode_bytes, bp_opcode_size));
- return Error();
+ return Error::success();
}
Error SoftwareBreakpoint::EnableSoftwareBreakpoint(
@@ -219,7 +219,7 @@
log->Printf("SoftwareBreakpoint::%s addr = 0x%" PRIx64 " -- SUCCESS",
__FUNCTION__, addr);
- return Error();
+ return Error::success();
}
// -------------------------------------------------------------------