[Lldb-commits] [PATCH] D47991: Add method SBThread::StepOver with SBError parameter.

Alexander Polyakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Jun 10 07:51:00 PDT 2018


apolyakov created this revision.
apolyakov added reviewers: aprantl, clayborg, labath.

The new method will allow to get error messages from StepOver function.


https://reviews.llvm.org/D47991

Files:
  include/lldb/API/SBThread.h
  source/API/SBThread.cpp


Index: source/API/SBThread.cpp
===================================================================
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -633,6 +633,11 @@
 }
 
 void SBThread::StepOver(lldb::RunMode stop_other_threads) {
+  SBError error;
+  StepOver(error, stop_other_threads);
+}
+
+void SBThread::StepOver(SBError &error, lldb::RunMode stop_other_threads) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock<std::recursive_mutex> lock;
@@ -662,9 +667,8 @@
       }
     }
 
-    // This returns an error, we should use it!
-    ResumeNewPlan(exe_ctx, new_plan_sp.get());
-  }
+    error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  } else error.SetErrorString("this SBThread object is invalid");
 }
 
 void SBThread::StepInto(lldb::RunMode stop_other_threads) {
Index: include/lldb/API/SBThread.h
===================================================================
--- include/lldb/API/SBThread.h
+++ include/lldb/API/SBThread.h
@@ -93,6 +93,9 @@
 
   void StepOver(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
 
+  void StepOver(SBError &error,
+                lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+
   void StepInto(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
 
   void StepInto(const char *target_name,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47991.150650.patch
Type: text/x-patch
Size: 1339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180610/2e733baa/attachment.bin>


More information about the lldb-commits mailing list