I’m wondering if one could get selected items from the bt command. E.g. to find the calling functions for a certain function.
The idea is basically to add a non-stop breakpoint at the function in question and then print the callstack e.g. calling function, maybe the calling function of that as well.
In the end this would likely boil down to filtering the result of the bt command. The filtering would be necessariy to exclude the framework and runtime methods in between.
I’m wondering if one could get selected items from the bt command. E.g. to
Share
You need to drop into a little Python scripting to do this today – it’s not bad.
I set my breakpoint (on
mach_msg() in this example), I add a command to my breakpoint (-s pythonmeans it is written in the scripting language python; I’m adding this command to breakpoint #1).The python code is supplied with the current breakpoint object and frame object automatically (see “
help break command add” in lldb). I get the current thread from the frame object, then iterate over the stack frames for that thread.lldb has lots of built in information about what operations you can do on these python objects. e.g.
See also http://lldb.llvm.org/python-reference.html