【问题标题】:LLDB Restart process without user input无需用户输入的 LLDB 重启过程
【发布时间】:2015-06-03 16:17:22
【问题描述】:

我正在尝试在 LLDB 中调试并发程序,但遇到了 seg 错误,但不是在每次执行时都出现。我想一遍又一遍地运行我的进程,直到它遇到段错误。到目前为止,我有以下内容:

b exit
breakpoint com add 1
Enter your debugger command(s).  Type 'DONE' to end.
> run 
> DONE

我觉得烦人的部分是,当我到达退出函数并命中断点时,当run 命令被执行时,我从 LLDB 收到以下提示:

There is a running process, kill it and restart?: [Y/n] 

我想自动重启进程,而不必每次都手动输入Y。有人知道怎么做吗?

【问题讨论】:

    标签: debugging lldb


    【解决方案1】:

    您可以使用 kill 手动终止前一个实例 - 它不会提示 - 然后 run 命令也不会提示。

    或者:

    (lldb) settings set auto-confirm 1
    

    将为所有 lldb 查询提供默认(大写)答案。

    或者,如果您有 Xcode 6.x(或当前 TOT svn lldb),您可以使用 lldb 驱动程序的批处理模式:

    $ lldb --help
    ...
           -b 
           --batch 
                Tells the debugger to running the commands from -s, -S, -o & -O,
                and then quit.  However if any run command stopped due to a signal
                or crash, the debugger will return to the interactive prompt at the
                place of the crash.
    

    例如,您可以在 shell 中编写脚本,运行:

    lldb -b -o 运行

    在一个循环中,如果运行以崩溃而不是正常退出结束,这将停止。在某些情况下,这可能更容易做到。

    【讨论】:

    • 完美,这些解决方案中的每一个都正是我想要的。谢谢
    猜你喜欢
    • 2016-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-29
    • 2015-12-01
    相关资源
    最近更新 更多