<div dir="ltr">Came from a Windows world thought this is trivial to do. Thanks for the explanation. </div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 31, 2015 at 4:34 PM, Jim Ingham <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">lldb doesn't attempt to generate thread creation & destruction events at present. If it did there would be a "threadCreated" event on the process, but as you see there isn't...<br>
<br>
There was some discussion about this a little while ago on the list. IMHBSEO the debugger should interfere with the running of a program as little as possible when the target is just running flat out. So I wouldn't want lldb to watch thread creation and destruction by default, since you will end up starting and stopping the target much more often for information that in general you don't want to see.<br>
<br>
But it would be fine to add a setting that you could turn on in lldb to try to catch thread create/destroy. For extra credit, you could flip this on when somebody signs up for the thread creation events we would vend.<br>
<br>
Anyway, IIUC gathering these events would be easy to do on Linux, since you already have to be notified of new thread creation so you can attach to them.<br>
<br>
On OS X it would be trickier. There is no kernel level notification of thread creation or destruction. You could get thread creation by breaking on the couple of functions OS X always uses to start up new threads. Getting destruction would be trickier since you'd have put a breakpoint in the thread create function on the return from the thread body function. That would probably be easy to tell by eyeballing the function's disassembly, but might be harder to determine programmatically.<br>
<br>
Feel free to file a bug or even better provide a patch if this is something you really need.<br>
<br>
Jim<br>
<span class=""><br>
> On Jul 31, 2015, at 3:13 PM, Jeffrey Tan <<a href="mailto:jeffrey.fudan@gmail.com">jeffrey.fudan@gmail.com</a>> wrote:<br>
><br>
> How to receive thread create/destroy events from LLDB? I did not find a broadcast bit from SBTarget or SBProcess or SBThread. I have enabled both SBProcess.eBroadcastBitStateChanged and SBTarget.eBroadcastBitBreakpointChanged, but still did not retrieve any thread create/destroy event via SBThread.EventIsThreadEvent().<br>
><br>
> I know I can query for all threads while process is paused but thread can be create/destroy in run mode so it is important/useful for debugger client to receive this kind of notification.<br>
</span>> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div><br></div>