diff options
author | Alexander Polyakov <polyakov.alx@gmail.com> | 2018-08-07 20:23:57 +0000 |
---|---|---|
committer | Alexander Polyakov <polyakov.alx@gmail.com> | 2018-08-07 20:23:57 +0000 |
commit | 3e7b9db2d9943eadc953500c995919a8168cd56a (patch) | |
tree | 791ee58b940686c2ad931e2545a9cb95b6c0ebe2 /lldb/source/API/SBTarget.cpp | |
parent | 4364d604c21141794a274166e6b3925e51887e31 (diff) | |
download | bcm5719-llvm-3e7b9db2d9943eadc953500c995919a8168cd56a.tar.gz bcm5719-llvm-3e7b9db2d9943eadc953500c995919a8168cd56a.zip |
Add new API to SBTarget class
Summary:
The new API appends an image search path to the
target's path mapping list.
Reviewers: aprantl, clayborg, labath
Reviewed By: aprantl
Subscribers: ki.stfu, lldb-commits
Differential Revision: https://reviews.llvm.org/D49739
llvm-svn: 339175
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r-- | lldb/source/API/SBTarget.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 550d336906d..15cdb0f312c 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -1457,6 +1457,26 @@ bool SBTarget::DeleteAllWatchpoints() { 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("<from> path can't be empty"); + if (!csTo) + return error.SetErrorString("<to> path can't be empty"); + + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + if (log) + log->Printf("SBTarget(%p)::%s: '%s' -> '%s'", + static_cast<void *>(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); |