JDevlieghere added a comment.

In D93926#2486038 <https://reviews.llvm.org/D93926#2486038>, @lanza wrote:

> I guess if the intention of that is maintain the debugger instance around it 
> should work, but at the moment it segfaults pretty quick with Xcode's lldb 
> using:

Hmm, the debugger somehow gets borked when it's passed into the `background` 
method. If I call `GetID()` on it, it returns a totally bogus value. I need to 
read up on how these objects are passed to new threads. The following script 
works as expected:

  import threading
  import lldb
  import time
  
  def background(debugger_id: int):
      debugger = lldb.SBDebugger.FindDebuggerWithID(debugger_id)
      while True:
          time.sleep(1)
          print(debugger)
  
  def __lldb_init_module(
    debugger: lldb.SBDebugger,
    internal_dict: dict
  ):
      threading.Thread()
      threading.Thread(target=background, args=(debugger.GetID(),)).start()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93926/new/

https://reviews.llvm.org/D93926

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to