Debugging LLDB在没有用户输入的情况下重新启动进程

Debugging LLDB在没有用户输入的情况下重新启动进程,debugging,lldb,Debugging,Lldb,我试图在LLDB中调试一个并发程序,但并不是每次执行都会出现seg错误。我想反复运行我的进程,直到它遇到seg故障。到目前为止,我有以下几点: b exit breakpoint com add 1 Enter your debugger command(s). Type 'DONE' to end. > run > DONE 我觉得恼人的是,当我进入exit函数并点击断点时,当执行run命令时,LLDB会给出以下提示: There is a running process,

我试图在LLDB中调试一个并发程序,但并不是每次执行都会出现seg错误。我想反复运行我的进程,直到它遇到seg故障。到目前为止,我有以下几点:

b exit
breakpoint com add 1
Enter your debugger command(s).  Type 'DONE' to end.
> run 
> DONE
我觉得恼人的是,当我进入exit函数并点击断点时,当执行
run
命令时,LLDB会给出以下提示:

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

我希望自动重新启动流程,而无需每次手动输入
Y
。有人知道怎么做吗?

你可以用
kill
手动杀死前一个实例-它不会提示-然后
run
命令也不会提示

或:

将为所有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运行


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

很好,这些解决方案正是我想要的。谢谢
$ 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.