[Lldb-commits] [lldb] r339175 - Add new API to SBTarget class
Alexander Polyakov via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 7 13:23:57 PDT 2018
Author: apolyakov
Date: Tue Aug 7 13:23:57 2018
New Revision: 339175
URL: http://llvm.org/viewvc/llvm-project?rev=339175&view=rev
Log:
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
Modified:
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/scripts/interface/SBTarget.i
lldb/trunk/source/API/SBTarget.cpp
Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=339175&r1=339174&r2=339175&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Tue Aug 7 13:23:57 2018
@@ -272,6 +272,9 @@ public:
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,
Modified: lldb/trunk/scripts/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBTarget.i?rev=339175&r1=339174&r2=339175&view=diff
==============================================================================
--- lldb/trunk/scripts/interface/SBTarget.i (original)
+++ lldb/trunk/scripts/interface/SBTarget.i Tue Aug 7 13:23:57 2018
@@ -373,6 +373,11 @@ public:
lldb::SBFileSpec
GetExecutable ();
+ void
+ AppendImageSearchPath (const char *from,
+ const char *to,
+ SBError &error);
+
bool
AddModule (lldb::SBModule &module);
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=339175&r1=339174&r2=339175&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Tue Aug 7 13:23:57 2018
@@ -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);
More information about the lldb-commits
mailing list