Matt
Matt

Reputation: 4049

LLDB: silently continue after python script is done executing

I've written a python script that I am attaching to a watchpoint in LLDB, such as:

def wpCallback(frame, wp, internal_dict):
    ...

and I am attaching the callback with:

watchpoint command add -F commands.wpCallback watchpointID

I would like execution of the program to immediately resume after wpCallback is finished. Currently, execution halts as the watchpoint normally would. Is it possible to silently continue after the function is done? Based on this answer it seems like you can do something like this in GDB:

break foo if x>0
commands
silent
do something...
cont
end

Upvotes: 2

Views: 690

Answers (1)

Jim Ingham
Jim Ingham

Reputation: 27110

You should be able to call SBProcess.Continue() on your process in your watchpoint callback. I.e. if you called the first argument to your callback frame do:

frame.thread.process.Continue()

That works for breakpoints, but seems to be broken for watchpoints in current TOT lldb. It looks like it disables the watchpoint. That's:

https://llvm.org/bugs/show_bug.cgi?id=28055

Upvotes: 1

Related Questions