永久配置 LLDB(在 Xcode 4.3.2 中)不停止信号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10431579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Permanently configuring LLDB (in Xcode 4.3.2) not to stop on signals
提问by puzzle
I'm trying to get LLDB (running in Xcode 4.3.2 with an OS X application) to not stop on certain signals. If I enter
我试图让 LLDB(使用 OS X 应用程序在 Xcode 4.3.2 中运行)不要在某些信号上停止。如果我输入
process handle SIGUSR2 -n true -p true -s false
process handle SIGUSR2 -n true -p true -s false
on the debugging console it works fine and LLDB no longer stops on SIGUSR2.
在调试控制台上它工作正常,LLDB 不再在 SIGUSR2 上停止。
However, if I put
但是,如果我把
command process handle SIGUSR2 -n true -p true -s false
command process handle SIGUSR2 -n true -p true -s false
into ~/.lldbinit it seems to be ignored. Other commands in this file (e.g. alias) work fine.
进入 ~/.lldbinit 它似乎被忽略了。此文件中的其他命令(例如别名)工作正常。
How can I make LLDB never stop on certain signals?
如何让 LLDB 在某些信号上永不停止?
回答by puzzle
In case anyone else ever has this question, I finally solved it by adding a breakpoint in NSApplicationMain()
(for plain C programs, main()
would of course work as well).
万一其他人有这个问题,我最终通过添加断点解决了它NSApplicationMain()
(对于普通的 C 程序,main()
当然也可以)。
I set the breakpoint action to process handle SIGUSR2 -n true -p true -s false
, and enabled the "Automatically continue after evaluating" option.
我将断点操作设置为process handle SIGUSR2 -n true -p true -s false
,并启用了“评估后自动继续”选项。
If anyone has a more elegant solution, I'd be happy to hear.
如果有人有更优雅的解决方案,我会很高兴听到。