[Lldb-commits] [PATCH] [lldb] ASan history threads SB API
jason at molenda.com
Thu Sep 4 11:02:33 PDT 2014
On Sep 4, 2014, at 10:52 AM, Enrico Granata <egranata at apple.com> wrote:
> Then what you probably want is to cache the list in the plugin and gate the validity of the cache on the StopID; if you know your cached list was fetched at stopid==3, you can keep serving it as long as stopid==3; as soon as that changes, then - wipe the cache, and refetch
I think he'd want to use the "natural stop id" which corresponds to public stop events. The process StopID changes with private stop events IIRC. e.g. you hit a breakpoint, StopID is 5. You run an expression, it completes successfully, StopID is 6. IIRC the natural StopID is still 5.
e.g. see the code I added to Process::UpdateThreadListIfNeeded() which clears out the m_extended_thread_list and m_queue_list every time we hit a public stop id.
You'll probably want to store your created Threads in a similar list in Process and clear them in a similar way that I'm doing there if you're going to take this approach.
The SBThreads (or SBThreadList) objects that you hand out will still exist, but the backing Threads will have all become invalid. When those SBThreads try to make a shared pointer from their weak pointer, it will fail and they will report that they are now invalid.
More information about the lldb-commits