[Lldb-commits] [PATCH] D49739: Add new API to SBTarget class

Alexander Polyakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 7 13:24:40 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339175: Add new API to SBTarget class (authored by apolyakov, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D49739?vs=159582&id=159587#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49739

Files:
  lldb/trunk/include/lldb/API/SBTarget.h
  lldb/trunk/scripts/interface/SBTarget.i
  lldb/trunk/source/API/SBTarget.cpp


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("<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: 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/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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49739.159587.patch
Type: text/x-patch
Size: 2127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180807/2d94f36c/attachment.bin>


More information about the lldb-commits mailing list