diff options
author | Zachary Turner <zturner@google.com> | 2017-05-12 04:51:55 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-05-12 04:51:55 +0000 |
commit | 97206d572797bddc1bba71bb1c18c97f19d69053 (patch) | |
tree | fdf21d24485672cf97c800264d135b9d5d2ecdce /lldb/tools/debugserver/source/MacOSX | |
parent | 3086b45a2fae833e8419885e78c598d936cc6429 (diff) | |
download | bcm5719-llvm-97206d572797bddc1bba71bb1c18c97f19d69053.tar.gz bcm5719-llvm-97206d572797bddc1bba71bb1c18c97f19d69053.zip |
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
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX')
7 files changed, 30 insertions, 29 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachException.cpp b/lldb/tools/debugserver/source/MacOSX/MachException.cpp index f6e778232b8..5f085867db2 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachException.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachException.cpp @@ -267,7 +267,7 @@ kern_return_t MachException::Message::Receive(mach_port_t port, exc_msg.hdr.msgh_reserved, exc_msg.hdr.msgh_id, options, 0, sizeof(exc_msg.data), port, mach_msg_timeout, notify_port); } - return err.Error(); + return err.Status(); } bool MachException::Message::CatchExceptionRaise(task_t task) { @@ -349,7 +349,7 @@ kern_return_t MachException::Message::Reply(MachProcess *process, int signal) { MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); if (err.Fail()) { - if (err.Error() == MACH_SEND_INTERRUPTED) { + if (err.Status() == MACH_SEND_INTERRUPTED) { if (DNBLogCheckLogBit(LOG_EXCEPTIONS)) err.LogThreaded("::mach_msg() - send interrupted"); // TODO: keep retrying to reply??? @@ -357,7 +357,7 @@ kern_return_t MachException::Message::Reply(MachProcess *process, int signal) { if (state.task_port == process->Task().TaskPort()) { DNBLogThreaded("error: mach_msg() returned an error when replying to a " "mach exception: error = %u", - err.Error()); + err.Status()); } else { if (DNBLogCheckLogBit(LOG_EXCEPTIONS)) err.LogThreaded("::mach_msg() - failed (child of task)"); @@ -365,7 +365,7 @@ kern_return_t MachException::Message::Reply(MachProcess *process, int signal) { } } - return err.Error(); + return err.Status(); } void MachException::Data::Dump() const { @@ -430,7 +430,7 @@ kern_return_t MachException::PortInfo::Save(task_t task) { "maskCnt => %u, ports, behaviors, flavors )", task, mask, count); - if (err.Error() == KERN_INVALID_ARGUMENT && mask != PREV_EXC_MASK_ALL) { + if (err.Status() == KERN_INVALID_ARGUMENT && mask != PREV_EXC_MASK_ALL) { mask = PREV_EXC_MASK_ALL; count = (sizeof(ports) / sizeof(ports[0])); err = ::task_get_exception_ports(task, mask, masks, &count, ports, @@ -444,7 +444,7 @@ kern_return_t MachException::PortInfo::Save(task_t task) { mask = 0; count = 0; } - return err.Error(); + return err.Status(); } kern_return_t MachException::PortInfo::Restore(task_t task) { @@ -469,7 +469,7 @@ kern_return_t MachException::PortInfo::Restore(task_t task) { } } count = 0; - return err.Error(); + return err.Status(); } const char *MachException::Name(exception_type_t exc_type) { diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm index 0daaca1db37..a93f724849b 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm @@ -1215,7 +1215,7 @@ bool MachProcess::Kill(const struct timespec *timeout_abstime) { err.SetErrorToErrno(); DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() ::ptrace " "(PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)", - m_pid, err.Error(), err.AsString()); + m_pid, err.Status(), err.AsString()); m_thread_actions = DNBThreadResumeActions(eStateRunning, 0); PrivateResume(); @@ -2970,7 +2970,8 @@ pid_t MachProcess::LaunchForDebug( DNBError ptrace_err(errno, DNBError::POSIX); DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to spawned pid " "%d (err = %i, errno = %i (%s))", - m_pid, err, ptrace_err.Error(), ptrace_err.AsString()); + m_pid, err, ptrace_err.Status(), + ptrace_err.AsString()); launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic); } } else { @@ -3181,7 +3182,7 @@ pid_t MachProcess::ForkChildForPTraceDebugging(const char *path, char const *envp[], MachProcess *process, DNBError &launch_err) { - PseudoTerminal::Error pty_error = PseudoTerminal::success; + PseudoTerminal::Status pty_error = PseudoTerminal::success; // Use a fork that ties the child process's stdin/out/err to a pseudo // terminal so we can read it in our MachProcess::STDIOThread @@ -3191,7 +3192,7 @@ pid_t MachProcess::ForkChildForPTraceDebugging(const char *path, if (pid < 0) { //-------------------------------------------------------------- - // Error during fork. + // Status during fork. //-------------------------------------------------------------- return pid; } else if (pid == 0) { @@ -3406,7 +3407,7 @@ pid_t MachProcess::SBForkChildForPTraceDebugging( PseudoTerminal pty; if (!no_stdio) { - PseudoTerminal::Error pty_err = + PseudoTerminal::Status pty_err = pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY); if (pty_err == PseudoTerminal::success) { const char *slave_name = pty.SlaveName(); @@ -3607,7 +3608,7 @@ pid_t MachProcess::BoardServiceForkChildForPTraceDebugging( PseudoTerminal pty; if (!no_stdio) { - PseudoTerminal::Error pty_err = + PseudoTerminal::Status pty_err = pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY); if (pty_err == PseudoTerminal::success) { const char *slave_name = pty.SlaveName(); diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.mm b/lldb/tools/debugserver/source/MacOSX/MachTask.mm index 37897a5a6ac..bd7047ecdff 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachTask.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachTask.mm @@ -88,7 +88,7 @@ kern_return_t MachTask::Suspend() { err = ::task_suspend(task); if (DNBLogCheckLogBit(LOG_TASK) || err.Fail()) err.LogThreaded("::task_suspend ( target_task = 0x%4.4x )", task); - return err.Error(); + return err.Status(); } //---------------------------------------------------------------------- @@ -113,7 +113,7 @@ kern_return_t MachTask::Resume() { err.LogThreaded("::task_resume ( target_task = 0x%4.4x )", task); } } - return err.Error(); + return err.Status(); } //---------------------------------------------------------------------- @@ -531,7 +531,7 @@ task_t MachTask::TaskPortForProcessID(pid_t pid, DNBError &err, char str[1024]; ::snprintf(str, sizeof(str), "::task_for_pid ( target_tport = 0x%4.4x, " "pid = %d, &task ) => err = 0x%8.8x (%s)", - task_self, pid, err.Error(), + task_self, pid, err.Status(), err.AsString() ? err.AsString() : "success"); if (err.Fail()) err.SetErrorString(str); @@ -583,7 +583,7 @@ kern_return_t MachTask::BasicInfo(task_t task, struct task_basic_info *info) { info->suspend_count, (uint64_t)info->virtual_size, (uint64_t)info->resident_size, user, system); } - return err.Error(); + return err.Status(); } //---------------------------------------------------------------------- @@ -687,7 +687,7 @@ kern_return_t MachTask::ShutDownExcecptionThread() { err.LogThreaded("::mach_port_deallocate ( task = 0x%4.4x, name = 0x%4.4x )", task_self, exception_port); - return err.Error(); + return err.Status(); } void *MachTask::ExceptionThread(void *arg) { @@ -805,7 +805,7 @@ void *MachTask::ExceptionThread(void *arg) { MACH_RCV_MSG | MACH_RCV_INTERRUPT, 0); } - if (err.Error() == MACH_RCV_INTERRUPTED) { + if (err.Status() == MACH_RCV_INTERRUPTED) { // If we have no task port we should exit this thread if (!mach_task->ExceptionPortIsValid()) { DNBLogThreadedIf(LOG_EXCEPTIONS, "thread cancelled..."); @@ -824,7 +824,7 @@ void *MachTask::ExceptionThread(void *arg) { // Our task has died, exit the thread. break; } - } else if (err.Error() == MACH_RCV_TIMED_OUT) { + } else if (err.Status() == MACH_RCV_TIMED_OUT) { if (num_exceptions_received > 0) { // We were receiving all current exceptions with a timeout of zero // it is time to go back to our normal looping mode @@ -860,7 +860,7 @@ void *MachTask::ExceptionThread(void *arg) { } } #endif - } else if (err.Error() != KERN_SUCCESS) { + } else if (err.Status() != KERN_SUCCESS) { DNBLogThreadedIf(LOG_EXCEPTIONS, "got some other error, do something " "about it??? nah, continuing for " "now..."); @@ -947,7 +947,7 @@ nub_addr_t MachTask::AllocateMemory(size_t size, uint32_t permissions) { DNBError err; err = ::mach_vm_allocate(task, &addr, size, TRUE); - if (err.Error() == KERN_SUCCESS) { + if (err.Status() == KERN_SUCCESS) { // Set the protections: vm_prot_t mach_prot = VM_PROT_NONE; if (permissions & eMemoryPermissionsReadable) @@ -958,7 +958,7 @@ nub_addr_t MachTask::AllocateMemory(size_t size, uint32_t permissions) { mach_prot |= VM_PROT_EXECUTE; err = ::mach_vm_protect(task, addr, size, 0, mach_prot); - if (err.Error() == KERN_SUCCESS) { + if (err.Status() == KERN_SUCCESS) { m_allocations.insert(std::make_pair(addr, size)); return addr; } diff --git a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp index cf0e205b349..05e9627b591 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp @@ -294,7 +294,7 @@ MachThreadList::UpdateThreadList(MachProcess *process, bool update, "thread_list_count => %u )", task, thread_list, thread_list_count); - if (err.Error() == KERN_SUCCESS && thread_list_count > 0) { + if (err.Status() == KERN_SUCCESS && thread_list_count > 0) { MachThreadList::collection currThreads; size_t idx; // Iterator through the current thread list and see which threads diff --git a/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp b/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp index 76806ab1cc1..12f16ccb9f5 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp @@ -501,7 +501,7 @@ nub_size_t MachVMMemory::Write(task_t task, nub_addr_t address, nub_size_t bytes_written = WriteRegion(task, curr_addr, curr_data, curr_data_count); if (bytes_written <= 0) { - // Error should have already be posted by WriteRegion... + // Status should have already be posted by WriteRegion... break; } else { total_bytes_written += bytes_written; diff --git a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp index 175aab1ae3f..2841ddb1108 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp +++ b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp @@ -696,14 +696,14 @@ kern_return_t DNBArchMachARM::EnableHardwareSingleStep(bool enable) { if (err.Fail()) { err.LogThreaded("%s: failed to read the GPR registers", __FUNCTION__); - return err.Error(); + return err.Status(); } err = GetDBGState(false); if (err.Fail()) { err.LogThreaded("%s: failed to read the DBG registers", __FUNCTION__); - return err.Error(); + return err.Status(); } // The use of __arm64__ here is not ideal. If debugserver is running on diff --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp index 7d04170623d..51bc5aaee5b 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp +++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp @@ -546,14 +546,14 @@ kern_return_t DNBArchMachARM64::EnableHardwareSingleStep(bool enable) { if (err.Fail()) { err.LogThreaded("%s: failed to read the GPR registers", __FUNCTION__); - return err.Error(); + return err.Status(); } err = GetDBGState(false); if (err.Fail()) { err.LogThreaded("%s: failed to read the DBG registers", __FUNCTION__); - return err.Error(); + return err.Status(); } if (enable) { |