Save breakpoints in LLDB

随声附和 提交于 2019-12-12 10:38:49

问题


How can I save breakpoints in lldb? This is a feature that gdb has and I suspect that lldb has it too but I haven't been able to find it in the help.

How this is done in gdb:

Getting gdb to save a list of breakpoints?


回答1:


As Jim Ingham said above, you currently cannot save breakpoints in lldb. However, there is a work around. You can load lldb commands from a command file as follows:

lldb -S <path_to_command_file>

You can have this in your command file:

file <path_to_binary>
breakpoint set --file file0.cc --line 22
breakpoint set --file file1.cc --line 237

The above command file will load the binary and set the breakpoints when lldb starts.




回答2:


You can you use breakpoint write to save current breakpoints to a file by using

breakpoint write -f debug

This saves your breakpoints to file 'debug'. However the saved breakpoints are not in a simple format compared to that of gdb.

You can read this file with breakpoint read -f debug when you start lldb.

The file is stored as a JSON, so you can read it in your text editor of choice. You can put the file wherever you want so instead of debug, you could do use ~/Desktop/myFilename.json




回答3:


This isn't currently possible.



来源:https://stackoverflow.com/questions/24638515/save-breakpoints-in-lldb

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