[lldb-dev] Threading model for Python API

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Mon Aug 5 09:15:16 PDT 2019


The API is thread safe, but you can run into interesting issues if you don't thread things right. You don't want one thread stepping and another thread resuming. It will work, but you probably will have a tough time figuring out why certain functions return certain values. Also, you don't want one thread resuming a process while another things the process is stopped and tries to get and display local variables.

So yes the API is thread safe, but be careful with how you use things.

Greg

> On Aug 5, 2019, at 8:59 AM, Christian Biesinger via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> Hi there!
> 
> I was wondering what the threading model is for the Python API (when
> running inside of LLDB, in implementing a command)?
> 
> For example: If I create a Python thread in my command, how do I
> access the LLDB API? Is there an equivalent of gdb's post_event
> function to run it on the main thread? Or is the API threadsafe?
> 
> I tried to look for documentation on this but was unsuccessful.
> 
> Thanks!
> Christian
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list