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/source/API | |
| 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/source/API')
| -rw-r--r-- | lldb/source/API/SBBreakpoint.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/API/SBBreakpointLocation.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/API/SBCommandReturnObject.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/API/SBDebugger.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/API/SBError.cpp | 18 | ||||
| -rw-r--r-- | lldb/source/API/SBFrame.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/API/SBHostOS.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/API/SBModule.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/API/SBPlatform.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/API/SBProcess.cpp | 8 | ||||
| -rw-r--r-- | lldb/source/API/SBStream.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/API/SBStructuredData.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/API/SBTarget.cpp | 10 | ||||
| -rw-r--r-- | lldb/source/API/SBThread.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/API/SBValue.cpp | 16 |
15 files changed, 55 insertions, 55 deletions
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp index 0b661a646f3..bf9603248d7 100644 --- a/lldb/source/API/SBBreakpoint.cpp +++ b/lldb/source/API/SBBreakpoint.cpp @@ -557,7 +557,7 @@ SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) { std::lock_guard<std::recursive_mutex> guard( bkpt_sp->GetTarget().GetAPIMutex()); BreakpointOptions *bp_options = bkpt_sp->GetOptions(); - Error error = + Status error = bkpt_sp->GetTarget() .GetDebugger() .GetCommandInterpreter() @@ -578,8 +578,8 @@ bool SBBreakpoint::AddName(const char *new_name) { if (bkpt_sp) { std::lock_guard<std::recursive_mutex> guard( bkpt_sp->GetTarget().GetAPIMutex()); - Error error; // Think I'm just going to swallow the error here, it's - // probably more annoying to have to provide it. + Status error; // Think I'm just going to swallow the error here, it's + // probably more annoying to have to provide it. return bkpt_sp->AddName(new_name, error); } diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp index d8779ffe2ba..dc9c00d8dd5 100644 --- a/lldb/source/API/SBBreakpointLocation.cpp +++ b/lldb/source/API/SBBreakpointLocation.cpp @@ -171,7 +171,7 @@ SBBreakpointLocation::SetScriptCallbackBody(const char *callback_body_text) { std::lock_guard<std::recursive_mutex> guard( loc_sp->GetTarget().GetAPIMutex()); BreakpointOptions *bp_options = loc_sp->GetLocationOptions(); - Error error = + Status error = loc_sp->GetBreakpoint() .GetTarget() .GetDebugger() diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp index 7eed94e05b1..5a8909b98e5 100644 --- a/lldb/source/API/SBCommandReturnObject.cpp +++ b/lldb/source/API/SBCommandReturnObject.cpp @@ -17,8 +17,8 @@ #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Utility/ConstString.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" using namespace lldb; using namespace lldb_private; @@ -182,7 +182,7 @@ bool SBCommandReturnObject::GetDescription(SBStream &description) { Stream &strm = description.ref(); if (m_opaque_ap) { - description.Printf("Status: "); + description.Printf("Error: "); lldb::ReturnStatus status = m_opaque_ap->GetStatus(); if (status == lldb::eReturnStatusStarted) strm.PutCString("Started"); @@ -271,7 +271,7 @@ void SBCommandReturnObject::SetError(lldb::SBError &error, if (error.IsValid()) m_opaque_ap->SetError(error.ref(), fallback_error_cstr); else if (fallback_error_cstr) - m_opaque_ap->SetError(Error(), fallback_error_cstr); + m_opaque_ap->SetError(Status(), fallback_error_cstr); } } diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 8d23d3eb850..3cdb6bbfd5f 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -57,7 +57,7 @@ using namespace lldb_private; static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, - Error &error) { + Status &error) { llvm::sys::DynamicLibrary dynlib = llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str()); if (dynlib.isValid()) { @@ -551,7 +551,7 @@ SBDebugger::CreateTargetWithFileAndTargetTriple(const char *filename, TargetSP target_sp; if (m_opaque_sp) { const bool add_dependent_modules = true; - Error error(m_opaque_sp->GetTargetList().CreateTarget( + Status error(m_opaque_sp->GetTargetList().CreateTarget( *m_opaque_sp, filename, target_triple, add_dependent_modules, nullptr, target_sp)); sb_target.SetSP(target_sp); @@ -574,7 +574,7 @@ SBTarget SBDebugger::CreateTargetWithFileAndArch(const char *filename, SBTarget sb_target; TargetSP target_sp; if (m_opaque_sp) { - Error error; + Status error; const bool add_dependent_modules = true; error = m_opaque_sp->GetTargetList().CreateTarget( @@ -600,7 +600,7 @@ SBTarget SBDebugger::CreateTarget(const char *filename) { SBTarget sb_target; TargetSP target_sp; if (m_opaque_sp) { - Error error; + Status error; const bool add_dependent_modules = true; error = m_opaque_sp->GetTargetList().CreateTarget( *m_opaque_sp, filename, "", add_dependent_modules, nullptr, target_sp); @@ -873,7 +873,7 @@ SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value, SBError sb_error; DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName( ConstString(debugger_instance_name))); - Error error; + Status error; if (debugger_sp) { ExecutionContext exe_ctx( debugger_sp->GetCommandInterpreter().GetExecutionContext()); @@ -894,7 +894,7 @@ SBDebugger::GetInternalVariableValue(const char *var_name, SBStringList ret_value; DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName( ConstString(debugger_instance_name))); - Error error; + Status error; if (debugger_sp) { ExecutionContext exe_ctx( debugger_sp->GetCommandInterpreter().GetExecutionContext()); diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp index a692a9678cd..b2811d0ac38 100644 --- a/lldb/source/API/SBError.cpp +++ b/lldb/source/API/SBError.cpp @@ -9,8 +9,8 @@ #include "lldb/API/SBError.h" #include "lldb/API/SBStream.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include <stdarg.h> @@ -21,7 +21,7 @@ SBError::SBError() : m_opaque_ap() {} SBError::SBError(const SBError &rhs) : m_opaque_ap() { if (rhs.IsValid()) - m_opaque_ap.reset(new Error(*rhs)); + m_opaque_ap.reset(new Status(*rhs)); } SBError::~SBError() {} @@ -31,7 +31,7 @@ const SBError &SBError::operator=(const SBError &rhs) { if (m_opaque_ap.get()) *m_opaque_ap = *rhs; else - m_opaque_ap.reset(new Error(*rhs)); + m_opaque_ap.reset(new Status(*rhs)); } else m_opaque_ap.reset(); @@ -108,7 +108,7 @@ void SBError::SetError(uint32_t err, ErrorType type) { m_opaque_ap->SetError(err, type); } -void SBError::SetError(const Error &lldb_error) { +void SBError::SetError(const Status &lldb_error) { CreateIfNeeded(); *m_opaque_ap = lldb_error; } @@ -141,19 +141,19 @@ bool SBError::IsValid() const { return m_opaque_ap.get() != NULL; } void SBError::CreateIfNeeded() { if (m_opaque_ap.get() == NULL) - m_opaque_ap.reset(new Error()); + m_opaque_ap.reset(new Status()); } -lldb_private::Error *SBError::operator->() { return m_opaque_ap.get(); } +lldb_private::Status *SBError::operator->() { return m_opaque_ap.get(); } -lldb_private::Error *SBError::get() { return m_opaque_ap.get(); } +lldb_private::Status *SBError::get() { return m_opaque_ap.get(); } -lldb_private::Error &SBError::ref() { +lldb_private::Status &SBError::ref() { CreateIfNeeded(); return *m_opaque_ap; } -const lldb_private::Error &SBError::operator*() const { +const lldb_private::Status &SBError::operator*() const { // Be sure to call "IsValid()" before calling this function or it will crash return *m_opaque_ap; } diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index d52bbe8069f..684a707dda9 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -606,7 +606,7 @@ lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path, frame = exe_ctx.GetFramePtr(); if (frame) { VariableSP var_sp; - Error error; + Status error; ValueObjectSP value_sp(frame->GetValueForVariableExpressionPath( var_path, eNoDynamicValues, StackFrame::eExpressionPathOptionCheckPtrVsMember | diff --git a/lldb/source/API/SBHostOS.cpp b/lldb/source/API/SBHostOS.cpp index c25499db89c..90b75a6ecd7 100644 --- a/lldb/source/API/SBHostOS.cpp +++ b/lldb/source/API/SBHostOS.cpp @@ -80,7 +80,7 @@ lldb::thread_t SBHostOS::ThreadCreate(const char *name, void SBHostOS::ThreadCreated(const char *name) {} bool SBHostOS::ThreadCancel(lldb::thread_t thread, SBError *error_ptr) { - Error error; + Status error; HostThread host_thread(thread); error = host_thread.Cancel(); if (error_ptr) @@ -90,7 +90,7 @@ bool SBHostOS::ThreadCancel(lldb::thread_t thread, SBError *error_ptr) { } bool SBHostOS::ThreadDetach(lldb::thread_t thread, SBError *error_ptr) { - Error error; + Status error; #if defined(_WIN32) if (error_ptr) error_ptr->SetErrorString("ThreadDetach is not supported on this platform"); @@ -106,7 +106,7 @@ bool SBHostOS::ThreadDetach(lldb::thread_t thread, SBError *error_ptr) { bool SBHostOS::ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result, SBError *error_ptr) { - Error error; + Status error; HostThread host_thread(thread); error = host_thread.Join(result); if (error_ptr) diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 3865ba92797..17f3dcc5656 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -37,8 +37,8 @@ SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {} SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() { ModuleSP module_sp; - Error error = ModuleList::GetSharedModule(*module_spec.m_opaque_ap, module_sp, - NULL, NULL, NULL); + Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_ap, + module_sp, NULL, NULL, NULL); if (module_sp) SetSP(module_sp); } diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp index 0f1b99236a7..87cbc4537a3 100644 --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -17,7 +17,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include "llvm/Support/FileSystem.h" @@ -205,7 +205,7 @@ const char *SBPlatformShellCommand::GetOutput() { SBPlatform::SBPlatform() : m_opaque_sp() {} SBPlatform::SBPlatform(const char *platform_name) : m_opaque_sp() { - Error error; + Status error; if (platform_name && platform_name[0]) m_opaque_sp = Platform::Create(ConstString(platform_name), error); } @@ -374,7 +374,7 @@ SBError SBPlatform::Put(SBFileSpec &src, SBFileSpec &dst) { return platform_sp->PutFile(src.ref(), dst.ref(), permissions); } - Error error; + Status error; error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", src.ref().GetPath().c_str()); return error; @@ -386,7 +386,7 @@ SBError SBPlatform::Install(SBFileSpec &src, SBFileSpec &dst) { if (src.Exists()) return platform_sp->Install(src.ref(), dst.ref()); - Error error; + Status error; error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", src.ref().GetPath().c_str()); return error; @@ -397,7 +397,7 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) { return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { const char *command = shell_command.GetCommand(); if (!command) - return Error("invalid shell command (empty)"); + return Status("invalid shell command (empty)"); const char *working_dir = shell_command.GetWorkingDirectory(); if (working_dir == NULL) { @@ -427,7 +427,7 @@ SBError SBPlatform::Kill(const lldb::pid_t pid) { } SBError SBPlatform::ExecuteConnected( - const std::function<Error(const lldb::PlatformSP &)> &func) { + const std::function<Status(const lldb::PlatformSP &)> &func) { SBError sb_error; const auto platform_sp(GetSP()); if (platform_sp) { diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index 0348113a987..8b79e521a37 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -281,7 +281,7 @@ size_t SBProcess::PutSTDIN(const char *src, size_t src_len) { size_t ret_val = 0; ProcessSP process_sp(GetSP()); if (process_sp) { - Error error; + Status error; ret_val = process_sp->PutSTDIN(src, src_len, error); } @@ -298,7 +298,7 @@ size_t SBProcess::GetSTDOUT(char *dst, size_t dst_len) const { size_t bytes_read = 0; ProcessSP process_sp(GetSP()); if (process_sp) { - Error error; + Status error; bytes_read = process_sp->GetSTDOUT(dst, dst_len, error); } @@ -317,7 +317,7 @@ size_t SBProcess::GetSTDERR(char *dst, size_t dst_len) const { size_t bytes_read = 0; ProcessSP process_sp(GetSP()); if (process_sp) { - Error error; + Status error; bytes_read = process_sp->GetSTDERR(dst, dst_len, error); } @@ -336,7 +336,7 @@ size_t SBProcess::GetAsyncProfileData(char *dst, size_t dst_len) const { size_t bytes_read = 0; ProcessSP process_sp(GetSP()); if (process_sp) { - Error error; + Status error; bytes_read = process_sp->GetAsyncProfileData(dst, dst_len, error); } diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp index 5ae5a01589d..159ec07e4e0 100644 --- a/lldb/source/API/SBStream.cpp +++ b/lldb/source/API/SBStream.cpp @@ -10,7 +10,7 @@ #include "lldb/API/SBStream.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" #include "lldb/Utility/StreamString.h" diff --git a/lldb/source/API/SBStructuredData.cpp b/lldb/source/API/SBStructuredData.cpp index 2fca56f2f22..971c4ab2295 100644 --- a/lldb/source/API/SBStructuredData.cpp +++ b/lldb/source/API/SBStructuredData.cpp @@ -14,7 +14,7 @@ #include "lldb/Core/StructuredData.h" #include "lldb/Core/StructuredDataImpl.h" #include "lldb/Target/StructuredDataPlugin.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" using namespace lldb; @@ -62,7 +62,7 @@ SBError SBStructuredData::GetAsJSON(lldb::SBStream &stream) const { } lldb::SBError SBStructuredData::GetDescription(lldb::SBStream &stream) const { - Error error = m_impl_up->GetDescription(stream.ref()); + Status error = m_impl_up->GetDescription(stream.ref()); SBError sb_error; sb_error.SetError(error); return sb_error; diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 4032383eb56..0ab7375ccc3 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -74,7 +74,7 @@ using namespace lldb_private; namespace { -Error AttachToProcess(ProcessAttachInfo &attach_info, Target &target) { +Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target) { std::lock_guard<std::recursive_mutex> guard(target.GetAPIMutex()); auto process_sp = target.GetProcessSP(); @@ -85,8 +85,8 @@ Error AttachToProcess(ProcessAttachInfo &attach_info, Target &target) { // listener, so if a valid listener is supplied, we need to error out // to let the client know. if (attach_info.GetListener()) - return Error("process is connected and already has a listener, pass " - "empty listener"); + return Status("process is connected and already has a listener, pass " + "empty listener"); } } @@ -1279,7 +1279,7 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size, } // Target::CreateWatchpoint() is thread safe. - Error cw_error; + Status cw_error; // This API doesn't take in a type, so we can't figure out what it is. CompilerType *type = NULL; watchpoint_sp = @@ -1863,7 +1863,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr, DataBufferHeap data( target_sp->GetArchitecture().GetMaximumOpcodeByteSize() * count, 0); bool prefer_file_cache = false; - lldb_private::Error error; + lldb_private::Status error; lldb::addr_t load_addr = LLDB_INVALID_ADDRESS; const size_t bytes_read = target_sp->ReadMemory(*addr_ptr, prefer_file_cache, data.GetBytes(), diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 3961a7f925a..be84c064c40 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -1037,7 +1037,7 @@ SBError SBThread::JumpToLine(lldb::SBFileSpec &file_spec, uint32_t line) { Thread *thread = exe_ctx.GetThreadPtr(); - Error err = thread->JumpToLine(file_spec.get(), line, true); + Status err = thread->JumpToLine(file_spec.get(), line, true); sb_error.SetError(err); return sb_error; } diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index ea0f9f591ab..b6f044c61a7 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -112,7 +112,7 @@ public: lldb::ValueObjectSP GetSP(Process::StopLocker &stop_locker, std::unique_lock<std::recursive_mutex> &lock, - Error &error) { + Status &error) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); if (!m_valobj_sp) { error.SetErrorString("invalid value object"); @@ -218,12 +218,12 @@ public: return in_value.GetSP(m_stop_locker, m_lock, m_lock_error); } - Error &GetError() { return m_lock_error; } + Status &GetError() { return m_lock_error; } private: Process::StopLocker m_stop_locker; std::unique_lock<std::recursive_mutex> m_lock; - Error m_lock_error; + Status m_lock_error; }; SBValue::SBValue() : m_opaque_sp() {} @@ -1112,7 +1112,7 @@ SBValue SBValue::Dereference() { ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { - Error error; + Status error; sb_value = value_sp->Dereference(error); } Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); @@ -1336,7 +1336,7 @@ lldb::SBValue SBValue::AddressOf() { ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { - Error error; + Status error; sb_value.SetSP(value_sp->AddressOf(error), GetPreferDynamicValue(), GetPreferSyntheticValue()); } @@ -1445,7 +1445,7 @@ lldb::SBData SBValue::GetData() { lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { DataExtractorSP data_sp(new DataExtractor()); - Error error; + Status error; value_sp->GetData(*data_sp, error); if (error.Success()) *sb_data = data_sp; @@ -1475,7 +1475,7 @@ bool SBValue::SetData(lldb::SBData &data, SBError &error) { error.SetErrorString("No data to set"); ret = false; } else { - Error set_error; + Status set_error; value_sp->SetData(*data_extractor, set_error); @@ -1541,7 +1541,7 @@ lldb::SBWatchpoint SBValue::Watch(bool resolve_location, bool read, bool write, if (write) watch_type |= LLDB_WATCH_TYPE_WRITE; - Error rc; + Status rc; CompilerType type(value_sp->GetCompilerType()); WatchpointSP watchpoint_sp = target_sp->CreateWatchpoint(addr, byte_size, &type, watch_type, rc); |

