Index: include/lldb/API/SBDebugger.h =================================================================== --- include/lldb/API/SBDebugger.h +++ include/lldb/API/SBDebugger.h @@ -161,6 +161,10 @@ bool SetCurrentPlatformSDKRoot(const char *sysroot); + bool AddCurrentTargetSharedObjectPath(const char *from, + const char *to, + lldb::SBError &error); + // FIXME: Once we get the set show stuff in place, the driver won't need // an interface to the Set/Get UseExternalEditor. bool SetUseExternalEditor(bool input); Index: source/API/SBDebugger.cpp =================================================================== --- source/API/SBDebugger.cpp +++ source/API/SBDebugger.cpp @@ -1123,6 +1123,38 @@ return false; } +bool SBDebugger::AddCurrentTargetSharedObjectPath(const char *from, + const char *to, + lldb::SBError &sb_error) { + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + auto target_sp = GetSelectedTarget().GetSP(); + + if (target_sp->IsValid()) { + if (from[0] && to[0]) { + if (log) + log->Printf("SBDebugger::AddCurrentPlatformSharedObjectPath: '%s' -> '%s'", + from, to); + target_sp->GetImageSearchPathList().Append( + ConstString(from), ConstString(to), true); + return true; + } else { + if (from[0]) + sb_error.SetErrorString(" can't be empty> " + "(SBDebugger::AddCurrentPlatformSharedObjectPath) " + "returned false"); + else + sb_error.SetErrorString(" can't be empty> " + "(SBDebugger::AddCurrentPlatformSharedObjectPath) " + "returned false"); + return false; + } + } + sb_error.SetErrorString("invalid target " + "(SBDebugger::AddCurrentPlatformSharedObjectPath) " + "returned false"); + return false; +} + bool SBDebugger::GetCloseInputOnEOF() const { return (m_opaque_sp ? m_opaque_sp->GetCloseInputOnEOF() : false); }