[lldb-dev] Listening for thread events

Jeffrey Tan via lldb-dev lldb-dev at lists.llvm.org
Sat Jan 30 22:47:02 PST 2016


Never mind, found the thread event_mask in threads.h. They are just not in
the python API reference page.

On Sat, Jan 30, 2016 at 10:28 PM, Jeffrey Tan <jeffrey.fudan at gmail.com>
wrote:

> What event_mask should be used for the thread event class? I did not find
> any. (Sorry for hijacking the thread)
>
> On Fri, Jan 29, 2016 at 4:02 PM, Jim Ingham via lldb-dev <
> lldb-dev at lists.llvm.org> wrote:
>
>> It’s unclear to me why it would be a problem to listen to every thread
>> object?  They aren’t terribly chatty or anything, and you can listen to all
>> of them with one listener.
>>
>> Note, you don’t have to sign up individually for every thread object’s
>> broadcaster.  That would be really annoying.  In lldb, you can listen to
>> individual broadcasters or “broadcaster event classes”.  You want to do the
>> latter.
>>
>> You get the event class name with the GetBroadcasterClassName method on
>> the class you are interested in (SBThread in this case) and then on your
>> listener call
>>
>> SBListener::StartListeningForEventClass
>>
>> If you do that, the debugger will sign your listener up for the objects
>> of that broadcaster class as they come and go.  That makes listening to
>> events on all the threads in your process quite straightforward.
>>
>> Hope this helps.
>>
>> Jim
>>
>>
>> On Jan 29, 2016, at 2:32 PM, John Lindal via lldb-dev <
>> lldb-dev at lists.llvm.org> wrote:
>>
>> I'm building an X11 UI on top of LLDB, and I'm stuck trying to listen for
>> thread events.
>>
>> lldb_private::Thread is a Broadcaster, but lldb::SBThread doesn't expose
>> a GetBroadcaster() event the way SBProcess does.
>>
>> I wouldn't really want to have to listen to every SBThread object, but
>> when the program stops, I could listen to the selected thread.  (Getting
>> the events from SBProcess would also work, if Process relayed them.)
>>
>> Is this a feature that has not yet been implemented?  I couldn't find any
>> related tickets in Bugzilla.
>>
>> Thanks,
>> John Lindal
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>>
>>
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160130/38add0a8/attachment.html>


More information about the lldb-dev mailing list