================
@@ -233,6 +233,10 @@ class LLDB_API SBFrame {
 
   void SetFrameSP(const lldb::StackFrameSP &lldb_object_sp);
 
+  /// Return an SBValue with an error message warning that the process is not
+  /// currently stopped.
----------------
jimingham wrote:

At the SB API level, if you are getting the ExecutionContext from an 
ExecutionContextRef represented by a Target, Process, Thread or Frame you 
should also hold the API mutex.  There are some cases where we don't actually 
require a process.  For instance SBTarget::CreateValueFromAddress can work on 
either a live process that's stopped or to look at static data on a non-running 
target.  But those seem like they are in the minority, and in that case, for 
instance, you could easily do:

if (!process || stop_locker.IsLocked())

so that wouldn't be particularly awkward.  

I can't think of a good reason why you would want to drop the API lock before 
the stop lock or vice versa.  There's the one place where Felipe swaps the 
stop_locker originally set for another, so long as this doesn't make that 
particularly awkward, this seems doable.

https://github.com/llvm/llvm-project/pull/152020
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to