[Lldb-commits] [PATCH] D93874: [process] fix exec support on Linux

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 11 15:37:51 PST 2021


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



More information about the lldb-commits mailing list