clayborg added inline comments.

================
Comment at: lldb/test/API/functionalities/exec/TestExec.py:93
+        # we clear all existing thread plans.
+        thread.StepInstruction(False)
+
----------------
On Darwin threads have unique identifiers and the thread ID before exec != 
thread ID after exec. On linux, we get the same thread ID for the thread that 
does exec: thread ID before exec == thread ID after exec. 

So on Darwin when we stop, we will remove all thread plans that are not part of 
the current thread list and since the globally unique thread ID has changed, it 
will toss out any thread plans for the old thread. On linux this stays around 
and since the ID is the same, and since the thread lists gets cleared on exec, 
we then have a case where the thread plan outlives the thread shared pointers. 
The thread lists (real and user visible) are cleared in 
ProcessGDBRemote::SetLastStopPacket() when did_exec == true.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93874/new/

https://reviews.llvm.org/D93874

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to