LLDB: silently continue after python script is done executing

人走茶凉 提交于 2021-02-10 06:26:03

问题


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

回答1:


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



来源:https://stackoverflow.com/questions/37622150/lldb-silently-continue-after-python-script-is-done-executing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!