[lldb-dev] Function tracing

Greg Clayton gclayton at apple.com
Mon Feb 23 12:30:42 PST 2015


> On Feb 23, 2015, at 11:33 AM, Bruce Mitchener <bruce.mitchener at gmail.com> wrote:
> 
> Jim,
> 
> Thanks for all of this great info!
> 
> Just two more questions for now ...
> 
> On Tue, Feb 24, 2015 at 2:08 AM, <jingham at apple.com> wrote:
> 
> > On Feb 22, 2015, at 7:42 PM, Bruce Mitchener <bruce.mitchener at gmail.com> wrote:
> >       • Is all of this safe against re-entry? What happens if I'm trying X and X gets invoked again (during the thread plan execution)?
> 
> The most straightforward way to do this would be to write something that just drives the event loop a la:
> 
> http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/process_events.py
> 
> Then recursion won't bother you.  The step plans stack, so if you do your "step-out" and before the step out completes you hit the breakpoint again, that's okay, the first step-out plan is still on the plan stack.  Do your "step-out" for the second breakpoint hit, and when that completes, "continue" and the original step-out plan will then get a chance to complete.  And since plans are per thread, doing this on multiple threads won't cause any problems either.
> 
> Ahh, I was going to do this from a command inside the LLDB CLI for now... Will that work well?
> 
> Also, will this prevent other threads from running while I have a function trace happening? (The comments in the code about this aren't clear to me.)

It will. When one thread stops all threads stop. Though multiple threads can stop, each at their own breakpoint, so you should be able to keep things going along. If one thread fails to step out due to a deadlock, just be sure to let other threads that did stop at breakpoints run.



More information about the lldb-dev mailing list