LLDB初始化时禁用信号 [英] Disable signals at LLDB initialization

查看:205
本文介绍了LLDB初始化时禁用信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的软件使用SIGUSR2信号,而我正在使用LLDB(在Xcode 4.6.2下)作为调试器.我想禁止LLDB在SIGUSR2处停止,并且一直在使用以下命令:

My software uses the SIGUSR2 signal and I am using LLDB (under Xcode 4.6.2) as my debugger. I would like to disable LLDB from stoping at SIGUSR2 and have been doing so using the command:

process handle --pass true --stop false --notify true SIGUSR2

我正在寻找让LLDB在启动时始终执行此命令的方法.我已经考虑在.lldbinit中的settings append target.process.extra-startup-command process行中添加一些内容,但是虽然这会更改target.process.extra-startup-command设置的值(由settings show命令证明),但我不确定是否/如何使用此设置始终执行process handle命令以禁用SIGUSR2信号.

I am looking for a way to have LLDB always execute this command at startup. I have looked into adding something along the lines of settings append target.process.extra-startup-command process in my .lldbinit, but while this changes the value of the target.process.extra-startup-command setting (as evidenced by the settings show command), I am uncertain if/how I can use this setting to always execute the process handle command to disable the SIGUSR2 signal.

我知道此处发布的解决方案":

I am aware of the "solution" posted here: Permanently configuring LLDB (in Xcode 4.3.2) not to stop on signals. I am looking however for a more elegant solution, if one exists.

推荐答案

目前,关于在main上的断点命令中执行此操作的建议是最可行的解决方案.

At present the suggestion of doing this in a breakpoint command on main is the most elegant solution available.

gdb具有这样一种世界观:所有进程(无论它们位于什么系统上)都可以神奇地响应UNIX信号.因此,有道理地说,当您有了一个进程之前,当进程获得SIGINT时将发生什么.在lldb中,该过程在创建时将告诉我们其信号是什么以及它们的默认行为.这很可爱,除了这意味着现在没有自然的地方可以在您进行处理之前存储信号行为的配置选项.这只是必须添加的内容.

gdb had this view of the world where all processes, no matter what system they might be on, magically responded to UNIX signals. So it made sense to say what was going to happen when the process got a SIGINT, say, before you even had a process. In lldb, the process, when it gets created, will tell us what its signals are and their default behaviors. That's lovely, except it means now there is no natural place to store configuration options for signal behaviors before you have a process. This is just something that has to get added.

触发流程生命周期事件"(不仅是流程启动",而且还有流程退出"和共享库负载"等)的功能将是一个很好的补充.此功能非常适合提出增强请求( http://bugreport.apple.com/ ),因为此类错误会成为功能的投票.

The ability to trigger off of "process life-cycle events", not just "process launch" but "process exit" and "shared library load" etc would be a great addition. This feature is something it would be great to file an enhancement request (http://bugreport.apple.com/) for, since bugs like that act as votes for features.

顺便说一句,target.process.extra-startup-command做的事情完全不同.它允许您在开始运行之前,在lldb发送到其调试代理(例如debugserver)的序列之前添加一些命令.它的主要用途是打开更多的debugserver日志记录.

BTW, target.process.extra-startup-command does something entirely different. It allows you to prepend some commands to the sequence lldb sends to its debug agent (e.g. debugserver) before we start running. Its main use is to turn on more debugserver logging.

这篇关于LLDB初始化时禁用信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆