aboutsummaryrefslogtreecommitdiff
path: root/source/API
diff options
context:
space:
mode:
Diffstat (limited to 'source/API')
-rw-r--r--source/API/SBBreakpoint.cpp6
-rw-r--r--source/API/SBBreakpointLocation.cpp2
-rw-r--r--source/API/SBCommandReturnObject.cpp6
-rw-r--r--source/API/SBDebugger.cpp12
-rw-r--r--source/API/SBError.cpp18
-rw-r--r--source/API/SBFrame.cpp2
-rw-r--r--source/API/SBHostOS.cpp6
-rw-r--r--source/API/SBModule.cpp4
-rw-r--r--source/API/SBPlatform.cpp12
-rw-r--r--source/API/SBProcess.cpp8
-rw-r--r--source/API/SBStream.cpp2
-rw-r--r--source/API/SBStructuredData.cpp4
-rw-r--r--source/API/SBTarget.cpp10
-rw-r--r--source/API/SBThread.cpp4
-rw-r--r--source/API/SBValue.cpp16
-rw-r--r--source/API/SystemInitializerFull.cpp3
16 files changed, 58 insertions, 57 deletions
diff --git a/source/API/SBBreakpoint.cpp b/source/API/SBBreakpoint.cpp
index 0b661a646f31..bf9603248d71 100644
--- a/source/API/SBBreakpoint.cpp
+++ b/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/source/API/SBBreakpointLocation.cpp b/source/API/SBBreakpointLocation.cpp
index d8779ffe2ba8..dc9c00d8dd57 100644
--- a/source/API/SBBreakpointLocation.cpp
+++ b/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/source/API/SBCommandReturnObject.cpp b/source/API/SBCommandReturnObject.cpp
index 7eed94e05b10..5a8909b98e53 100644
--- a/source/API/SBCommandReturnObject.cpp
+++ b/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/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index 8d23d3eb8505..3cdb6bbfd5f9 100644
--- a/source/API/SBDebugger.cpp
+++ b/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/source/API/SBError.cpp b/source/API/SBError.cpp
index a692a9678cde..b2811d0ac381 100644
--- a/source/API/SBError.cpp
+++ b/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/source/API/SBFrame.cpp b/source/API/SBFrame.cpp
index d52bbe8069f8..684a707dda94 100644
--- a/source/API/SBFrame.cpp
+++ b/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/source/API/SBHostOS.cpp b/source/API/SBHostOS.cpp
index c25499db89cd..90b75a6ecd7b 100644
--- a/source/API/SBHostOS.cpp
+++ b/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/source/API/SBModule.cpp b/source/API/SBModule.cpp
index 3865ba927977..17f3dcc5656d 100644
--- a/source/API/SBModule.cpp
+++ b/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/source/API/SBPlatform.cpp b/source/API/SBPlatform.cpp
index 0f1b99236a71..87cbc4537a3c 100644
--- a/source/API/SBPlatform.cpp
+++ b/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/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 0348113a9873..8b79e521a371 100644
--- a/source/API/SBProcess.cpp
+++ b/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/source/API/SBStream.cpp b/source/API/SBStream.cpp
index 5ae5a01589de..159ec07e4e02 100644
--- a/source/API/SBStream.cpp
+++ b/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/source/API/SBStructuredData.cpp b/source/API/SBStructuredData.cpp
index 2fca56f2f223..971c4ab2295d 100644
--- a/source/API/SBStructuredData.cpp
+++ b/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/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 4032383eb56c..0ab7375ccc30 100644
--- a/source/API/SBTarget.cpp
+++ b/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/source/API/SBThread.cpp b/source/API/SBThread.cpp
index 3961a7f925a0..2c82bc3bcdcf 100644
--- a/source/API/SBThread.cpp
+++ b/source/API/SBThread.cpp
@@ -562,7 +562,7 @@ bool SBThread::GetInfoItemByPathAsString(const char *path, SBStream &strm) {
info_root_sp->GetObjectForDotSeparatedPath(path);
if (node) {
if (node->GetType() == StructuredData::Type::eTypeString) {
- strm.Printf("%s", node->GetAsString()->GetValue().c_str());
+ strm.Printf("%s", node->GetAsString()->GetValue().str().c_str());
success = true;
}
if (node->GetType() == StructuredData::Type::eTypeInteger) {
@@ -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/source/API/SBValue.cpp b/source/API/SBValue.cpp
index ea0f9f591ab9..b6f044c61a78 100644
--- a/source/API/SBValue.cpp
+++ b/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);
diff --git a/source/API/SystemInitializerFull.cpp b/source/API/SystemInitializerFull.cpp
index 23aec1d6fa0a..6be352567e8b 100644
--- a/source/API/SystemInitializerFull.cpp
+++ b/source/API/SystemInitializerFull.cpp
@@ -400,7 +400,8 @@ void SystemInitializerFull::InitializeSWIG() {
}
void SystemInitializerFull::Terminate() {
- Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION);
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
Debugger::SettingsTerminate();