Forgive me if this was asked in the past. I did some combing through the 
archives with a "site:lists.llvm.org/pipermail/lldb-dev/ plugininitialize | 
Xcode | sbtarget” google query, but didn’t find anything relevant

My ultimate goal is to build a helper tool which compliments Xcode when 
debugging something.

To do this: I am using the C++ bool lldb::PluginInitialize(lldb::SBDebugger 
dbg) function call to initialize my plugin within LLDB’s process. From there, I 
am spawning a mach XPC anonymous service to coordinate talking with my LLDB 
plugin and a macOS GUI application.  This code is working great!


My problem is that at the time of my code being initialized (via Xcode calling 
into it via XPC), the SBDebugger is valid, but no SBTarget is valid (even the 
dummy one). This means I can not listen for events when the process starts up 
(i.e. SBProcess’s  eBroadCastBitStateChanged), nor monitor for any events being 
from the SBTarget. 

Since I am running code inside the LLDB.framework, I can of course do some wild 
and crazy stuff by injecting code to intercept when an SBTarget is being 
created, but I’d really rather avoid that in case you change the lldb_private 
APIs around.  So my question is: do you have a recommended way to be notified 
via code in a LLDB plugin when a target is initialized through Xcode? 

PS. I’ve read through the examples where a target is created directly via the 
SB APIs, but I can’t use those when Xcode is responsible for launching the 
SBTarget and SBProcess.


Thanks! Y’all are awesome 
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to