gpt4 book ai didi

debugging - LLDB 无需用户输入即可重启进程

转载 作者:行者123 更新时间:2023-12-04 00:25:57 35 4
gpt4 key购买 nike

我正在尝试在 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每一次。有人知道怎么做吗?

最佳答案

您可以使用 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 运行

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

关于debugging - LLDB 无需用户输入即可重启进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30625511/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com