LLDB - 评估并继续

时间:2017-01-03 20:20:30

标签: lldb

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>

3 个答案:

答案 0 :(得分:2)

我不清楚你在问什么。

但是如果你想把命令放在一个文本文件的某个地方,它会添加一个断点并向它添加命令,你需要这样的东西:

> 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调试会话。

这依赖于一个技巧,“breakpoint command add”命令在最后一个断点集上运行,这就是为什么我不必指定断点号。

答案 1 :(得分:1)

我想你问的是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

答案 2 :(得分:0)

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

相关问题