apolyakov updated this revision to Diff 159582.
apolyakov retitled this revision from "[WIP] Re-implement MI target-select
command." to "Add new API to SBTarget class".
apolyakov edited the summary of this revision.
apolyakov added a comment.
Splitted the patch into two parts: this part with the new API and another one
with re-implementing of target-select command.
The second part will be committed separately.
https://reviews.llvm.org/D49739
Files:
include/lldb/API/SBTarget.h
scripts/interface/SBTarget.i
source/API/SBTarget.cpp
Index: source/API/SBTarget.cpp
===================================================================
--- source/API/SBTarget.cpp
+++ 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("<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);
Index: scripts/interface/SBTarget.i
===================================================================
--- scripts/interface/SBTarget.i
+++ 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: include/lldb/API/SBTarget.h
===================================================================
--- include/lldb/API/SBTarget.h
+++ 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: source/API/SBTarget.cpp
===================================================================
--- source/API/SBTarget.cpp
+++ 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("<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);
Index: scripts/interface/SBTarget.i
===================================================================
--- scripts/interface/SBTarget.i
+++ 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: include/lldb/API/SBTarget.h
===================================================================
--- include/lldb/API/SBTarget.h
+++ 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,
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits