The way you do this in lldb is to write a Python-based breakpoint command that checks the stack of the thread that hits the breakpoint and continues if it does not contain a frame with this function. Stop commands tell lldb to stop or not, returning True or False respectively from the function. Therefore, a very simple way to do this is to make a Python file (break_here.py):
import lldb
desired_func = "some_func"
def break_here(frame, bp_loc, dict):
thread = frame.thread
for frame in thread.frames:
if frame.name == desired_func:
return True
return False
Suppose this file is located in / tmp. Then in lldb you will do:
(lldb) com scr imp /tmp/break_here.py
(lldb) br s -n whatever
(lldb) br com add --python-function break_here.break_here
source
share