Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.
A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error". Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around. Hopefully nothing too
serious.
llvm-svn: 302872
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
index 93d294f..3046150 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -111,8 +111,8 @@
void ProcessFreeBSD::Terminate() {}
-Error ProcessFreeBSD::DoDetach(bool keep_stopped) {
- Error error;
+Status ProcessFreeBSD::DoDetach(bool keep_stopped) {
+ Status error;
if (keep_stopped) {
error.SetErrorString("Detaching with keep_stopped true is not currently "
"supported on FreeBSD.");
@@ -127,7 +127,7 @@
return error;
}
-Error ProcessFreeBSD::DoResume() {
+Status ProcessFreeBSD::DoResume() {
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
SetPrivateState(eStateRunning);
@@ -147,7 +147,7 @@
m_monitor->ThreadSuspend(*t_pos, false);
do_step = true;
if (software_single_step) {
- Error error = SetupSoftwareSingleStepping(*t_pos);
+ Status error = SetupSoftwareSingleStepping(*t_pos);
if (error.Fail())
return error;
}
@@ -168,7 +168,7 @@
else
m_monitor->Resume(GetID(), m_resume_signo);
- return Error();
+ return Status();
}
bool ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list,
@@ -209,7 +209,7 @@
return true;
}
-Error ProcessFreeBSD::WillResume() {
+Status ProcessFreeBSD::WillResume() {
m_resume_signo = 0;
m_suspend_tids.clear();
m_run_tids.clear();
@@ -293,9 +293,10 @@
return true;
}
-Error ProcessFreeBSD::DoAttachToProcessWithID(
- lldb::pid_t pid, const ProcessAttachInfo &attach_info) {
- Error error;
+Status
+ProcessFreeBSD::DoAttachToProcessWithID(lldb::pid_t pid,
+ const ProcessAttachInfo &attach_info) {
+ Status error;
assert(m_monitor == NULL);
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
@@ -343,8 +344,8 @@
return error;
}
-Error ProcessFreeBSD::WillLaunch(Module *module) {
- Error error;
+Status ProcessFreeBSD::WillLaunch(Module *module) {
+ Status error;
return error;
}
@@ -366,8 +367,9 @@
return file_spec;
}
-Error ProcessFreeBSD::DoLaunch(Module *module, ProcessLaunchInfo &launch_info) {
- Error error;
+Status ProcessFreeBSD::DoLaunch(Module *module,
+ ProcessLaunchInfo &launch_info) {
+ Status error;
assert(m_monitor == NULL);
FileSpec working_dir = launch_info.GetWorkingDirectory();
@@ -456,8 +458,8 @@
return LLDB_INVALID_ADDRESS;
}
-Error ProcessFreeBSD::DoHalt(bool &caused_stop) {
- Error error;
+Status ProcessFreeBSD::DoHalt(bool &caused_stop) {
+ Status error;
if (IsStopped()) {
caused_stop = false;
@@ -470,8 +472,8 @@
return error;
}
-Error ProcessFreeBSD::DoSignal(int signal) {
- Error error;
+Status ProcessFreeBSD::DoSignal(int signal) {
+ Status error;
if (kill(GetID(), signal))
error.SetErrorToErrno();
@@ -479,8 +481,8 @@
return error;
}
-Error ProcessFreeBSD::DoDestroy() {
- Error error;
+Status ProcessFreeBSD::DoDestroy() {
+ Status error;
if (!HasExited()) {
assert(m_monitor);
@@ -513,7 +515,7 @@
target->GetArchitecture());
FileSpecList executable_search_paths(
Target::GetDefaultExecutableSearchPaths());
- Error error = platform_sp->ResolveExecutable(
+ Status error = platform_sp->ResolveExecutable(
exe_module_spec, exe_module_sp,
executable_search_paths.GetSize() ? &executable_search_paths : NULL);
if (!error.Success())
@@ -589,19 +591,19 @@
}
size_t ProcessFreeBSD::DoReadMemory(addr_t vm_addr, void *buf, size_t size,
- Error &error) {
+ Status &error) {
assert(m_monitor);
return m_monitor->ReadMemory(vm_addr, buf, size, error);
}
size_t ProcessFreeBSD::DoWriteMemory(addr_t vm_addr, const void *buf,
- size_t size, Error &error) {
+ size_t size, Status &error) {
assert(m_monitor);
return m_monitor->WriteMemory(vm_addr, buf, size, error);
}
addr_t ProcessFreeBSD::DoAllocateMemory(size_t size, uint32_t permissions,
- Error &error) {
+ Status &error) {
addr_t allocated_addr = LLDB_INVALID_ADDRESS;
unsigned prot = 0;
@@ -626,8 +628,8 @@
return allocated_addr;
}
-Error ProcessFreeBSD::DoDeallocateMemory(lldb::addr_t addr) {
- Error error;
+Status ProcessFreeBSD::DoDeallocateMemory(lldb::addr_t addr) {
+ Status error;
MMapMap::iterator pos = m_addr_to_mmap_size.find(addr);
if (pos != m_addr_to_mmap_size.end() &&
InferiorCallMunmap(this, addr, pos->second))
@@ -691,16 +693,16 @@
return opcode_size;
}
-Error ProcessFreeBSD::EnableBreakpointSite(BreakpointSite *bp_site) {
+Status ProcessFreeBSD::EnableBreakpointSite(BreakpointSite *bp_site) {
return EnableSoftwareBreakpoint(bp_site);
}
-Error ProcessFreeBSD::DisableBreakpointSite(BreakpointSite *bp_site) {
+Status ProcessFreeBSD::DisableBreakpointSite(BreakpointSite *bp_site) {
return DisableSoftwareBreakpoint(bp_site);
}
-Error ProcessFreeBSD::EnableWatchpoint(Watchpoint *wp, bool notify) {
- Error error;
+Status ProcessFreeBSD::EnableWatchpoint(Watchpoint *wp, bool notify) {
+ Status error;
if (wp) {
user_id_t watchID = wp->GetID();
addr_t addr = wp->GetLoadAddress();
@@ -754,8 +756,8 @@
return error;
}
-Error ProcessFreeBSD::DisableWatchpoint(Watchpoint *wp, bool notify) {
- Error error;
+Status ProcessFreeBSD::DisableWatchpoint(Watchpoint *wp, bool notify) {
+ Status error;
if (wp) {
user_id_t watchID = wp->GetID();
addr_t addr = wp->GetLoadAddress();
@@ -797,8 +799,8 @@
return error;
}
-Error ProcessFreeBSD::GetWatchpointSupportInfo(uint32_t &num) {
- Error error;
+Status ProcessFreeBSD::GetWatchpointSupportInfo(uint32_t &num) {
+ Status error;
std::lock_guard<std::recursive_mutex> guard(m_thread_list.GetMutex());
FreeBSDThread *thread = static_cast<FreeBSDThread *>(
m_thread_list.GetThreadAtIndex(0, false).get());
@@ -809,8 +811,8 @@
return error;
}
-Error ProcessFreeBSD::GetWatchpointSupportInfo(uint32_t &num, bool &after) {
- Error error = GetWatchpointSupportInfo(num);
+Status ProcessFreeBSD::GetWatchpointSupportInfo(uint32_t &num, bool &after) {
+ Status error = GetWatchpointSupportInfo(num);
// Watchpoints trigger and halt the inferior after
// the corresponding instruction has been executed.
after = true;
@@ -855,7 +857,7 @@
return m_byte_order;
}
-size_t ProcessFreeBSD::PutSTDIN(const char *buf, size_t len, Error &error) {
+size_t ProcessFreeBSD::PutSTDIN(const char *buf, size_t len, Status &error) {
ssize_t status;
if ((status = write(m_monitor->GetTerminalFD(), buf, len)) < 0) {
error.SetErrorToErrno();
@@ -943,7 +945,7 @@
lldb::addr_t addr, void *dst, size_t length) {
EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
- Error error;
+ Status error;
size_t bytes_read =
emulator_baton->m_process->DoReadMemory(addr, dst, length, error);
if (!error.Success())
@@ -998,9 +1000,9 @@
return false;
}
-Error ProcessFreeBSD::SetSoftwareSingleStepBreakpoint(lldb::tid_t tid,
- lldb::addr_t addr) {
- Error error;
+Status ProcessFreeBSD::SetSoftwareSingleStepBreakpoint(lldb::tid_t tid,
+ lldb::addr_t addr) {
+ Status error;
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
if (log) {
@@ -1010,8 +1012,8 @@
// Validate the address.
if (addr == LLDB_INVALID_ADDRESS)
- return Error("ProcessFreeBSD::%s invalid load address specified.",
- __FUNCTION__);
+ return Status("ProcessFreeBSD::%s invalid load address specified.",
+ __FUNCTION__);
Breakpoint *const sw_step_break =
m_process->GetTarget().CreateBreakpoint(addr, true, false).get();
@@ -1023,7 +1025,7 @@
__FUNCTION__, addr);
m_threads_stepping_with_breakpoint.insert({tid, sw_step_break->GetID()});
- return Error();
+ return Status();
}
bool ProcessFreeBSD::IsSoftwareStepBreakpoint(lldb::tid_t tid) {
@@ -1063,18 +1065,18 @@
return true;
}
-Error ProcessFreeBSD::SetupSoftwareSingleStepping(lldb::tid_t tid) {
+Status ProcessFreeBSD::SetupSoftwareSingleStepping(lldb::tid_t tid) {
std::unique_ptr<EmulateInstruction> emulator_ap(
EmulateInstruction::FindPlugin(GetTarget().GetArchitecture(),
eInstructionTypePCModifying, nullptr));
if (emulator_ap == nullptr)
- return Error("Instruction emulator not found!");
+ return Status("Instruction emulator not found!");
FreeBSDThread *thread = static_cast<FreeBSDThread *>(
m_thread_list.FindThreadByID(tid, false).get());
if (thread == NULL)
- return Error("Thread not found not found!");
+ return Status("Thread not found not found!");
lldb::RegisterContextSP register_context_sp = thread->GetRegisterContext();
@@ -1086,7 +1088,7 @@
emulator_ap->SetWriteRegCallback(&WriteRegisterCallback);
if (!emulator_ap->ReadInstruction())
- return Error("Read instruction failed!");
+ return Status("Read instruction failed!");
bool emulation_result =
emulator_ap->EvaluateInstruction(eEmulateInstructionOptionAutoAdvancePC);
@@ -1111,9 +1113,9 @@
// The instruction emulation failed after it modified the PC. It is an
// unknown error where we can't continue because the next instruction is
// modifying the PC but we don't know how.
- return Error("Instruction emulation failed unexpectedly");
+ return Status("Instruction emulation failed unexpectedly");
}
SetSoftwareSingleStepBreakpoint(tid, next_pc);
- return Error();
+ return Status();
}