Index: lldb/trunk/include/lldb/API/SBTarget.h =================================================================== --- lldb/trunk/include/lldb/API/SBTarget.h +++ lldb/trunk/include/lldb/API/SBTarget.h @@ -272,6 +272,9 @@ lldb::SBFileSpec GetExecutable(); + void AppendImageSearchPath(const char *from, const char *to, + lldb::SBError &error); + bool AddModule(lldb::SBModule &module); lldb::SBModule AddModule(const char *path, const char *triple, Index: lldb/trunk/scripts/interface/SBTarget.i =================================================================== --- lldb/trunk/scripts/interface/SBTarget.i +++ lldb/trunk/scripts/interface/SBTarget.i @@ -373,6 +373,11 @@ lldb::SBFileSpec GetExecutable (); + void + AppendImageSearchPath (const char *from, + const char *to, + SBError &error); + bool AddModule (lldb::SBModule &module); Index: lldb/trunk/source/API/SBTarget.cpp =================================================================== --- lldb/trunk/source/API/SBTarget.cpp +++ lldb/trunk/source/API/SBTarget.cpp @@ -1457,6 +1457,26 @@ return false; } +void SBTarget::AppendImageSearchPath(const char *from, const char *to, + lldb::SBError &error) { + TargetSP target_sp(GetSP()); + if (!target_sp) + return error.SetErrorString("invalid target"); + + const ConstString csFrom(from), csTo(to); + if (!csFrom) + return error.SetErrorString(" path can't be empty"); + if (!csTo) + return error.SetErrorString(" path can't be empty"); + + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + if (log) + log->Printf("SBTarget(%p)::%s: '%s' -> '%s'", + static_cast(target_sp.get()), __FUNCTION__, + from, to); + target_sp->GetImageSearchPathList().Append(csFrom, csTo, true); +} + lldb::SBModule SBTarget::AddModule(const char *path, const char *triple, const char *uuid_cstr) { return AddModule(path, triple, uuid_cstr, NULL);