diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBDebugger.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/API/SBDebugger.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp b/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp index 97e6f7b..3cdb6bb 100644 --- a/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp +++ b/contrib/llvm/tools/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()); @@ -1120,13 +1120,23 @@ SBTypeSynthetic SBDebugger::GetSyntheticForType(SBTypeNameSpecifier type_name) { } #endif // LLDB_DISABLE_PYTHON +static llvm::ArrayRef<const char *> GetCategoryArray(const char **categories) { + if (categories == nullptr) + return {}; + size_t len = 0; + while (categories[len] != nullptr) + ++len; + return llvm::makeArrayRef(categories, len); +} + bool SBDebugger::EnableLog(const char *channel, const char **categories) { if (m_opaque_sp) { uint32_t log_options = LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_THREAD_NAME; - StreamString errors; - return m_opaque_sp->EnableLog(channel, categories, nullptr, log_options, - errors); + std::string error; + llvm::raw_string_ostream error_stream(error); + return m_opaque_sp->EnableLog(channel, GetCategoryArray(categories), "", + log_options, error_stream); } else return false; } |