lldbinit中的进程句柄 [英] process handle in lldbinit

查看:198
本文介绍了lldbinit中的进程句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用以下命令初始化我的.lldbinit.

I'd like to have the following command init my .lldbinit.

process handle SIGPROF -n false -p true -s false

问题是lldb在启动时还没有运行该命令,而没有进程.

The problem is that lldb won't run this command when it starts up and doesn't yet have a process.

错误:在命令#1之后的命令中止读取:'进程句柄 SIGPROF -n false -p true -s false'失败,并出现错误:无当前 目标;除非您有有效的目标,否则无法处理信号 过程.

error: Aborting reading of commands after command #1: ' process handle SIGPROF -n false -p true -s false' failed with error: No current target; cannot handle signals until you have a valid target and process.

我如何告诉lldb每当有进程时就应用此命令?

How can I tell lldb to apply this command whenever it does have a process?

推荐答案

一种解决方法是,在加载调试文件后,将要在lldb中运行的命令集放入文件中,然后运行:

One workaround for this is to take the set of commands you want to run in lldb after the file you are debugging is loaded, put them in a file, and run:

$ lldb -s <command file> <FileToBeDebugged>

然后,如果您喜欢并经常使用它,则可以将shell别名设置为.最大为.

Then if you like this and use it often, you can make a shell alias of part up to .

如果您使用的是Xcode,一个常见的技巧是在项目的main处设置一个断点,将要运行的命令放在此处,然后将其设置为自动继续".

If you are using Xcode, a common trick is to set a breakpoint at main in your project, put the commands you want to run there, and then make it "auto-continue".

这篇关于lldbinit中的进程句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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