XCode具有设置断点的功能,然后运行lldb命令并“在计算后自动继续”。
如何通过--source设置相同的功能?在手册中找到--command引号,但在命令帮助中没有示例,也没有引用。
By default, the breakpoint command add command takes lldb command line commands. You can also specify this explicitly by passing the "--command" option.
Syntax: command <sub-command> [<sub-command-options>] <breakpoint-id>发布于 2018-06-07 15:32:55
我想你是在问关于自动继续使用lldb的问题?
我使用modify命令添加自动继续。
(lldb) b CCCryptorCreate
Breakpoint 1: where = libcommonCrypto.dylib`CCCryptorCreate, address = 0x000000011047e1b7
(lldb) breakpoint modify --auto-continue true 1
(lldb) br list
Current breakpoints:
1: name = 'CCCryptorCreate', locations = 1, resolved = 1, hit count = 0 Options: enabled auto-continue
1.1: where = libcommonCrypto.dylib`CCCryptorCreate, address = 0x000000011047e1b7, resolved, hit count = 0 然后添加一些我使用的命令。
(lldb) breakpoint command add -s python 1
Enter your Python command(s). Type 'DONE' to end.
print "Hit this breakpoint!"
DONE该帮助有一些很好的示例(lldb) help breakpoint command add
发布于 2017-01-09 20:39:27
我不太清楚你在问什么。
但是,如果您希望将命令放在某个文本文件中,这将添加、设置一个断点并向其添加命令,则需要如下所示:
> cat /tmp/cmds.lldb
break set -F main
break command add
frame var
continue
DONE
> lldb -s /tmp/cmds.lldb myBinary或者,如果您想在Xcode中这样做,只需使用:
(lldb) command source /tmp/cmds.lldb一旦您处于Xcode调试会话中。
这依赖于一个技巧,即“断点命令add”命令对最后一个断点集进行操作,这就是为什么我不必指定断点号。
发布于 2017-01-03 21:29:26
help breakpoint command add揭示它的名字叫--one-liner,--command一定是一个错误吗?
-o <one-line-command> ( --one-liner <one-line-command> )
Specify a one-line breakpoint command inline.问题是实际的,如何在使用continue时自动执行--source?
https://stackoverflow.com/questions/41451677
复制相似问题