问题描述
.lldbinit
用于在xCode启动之前预加载一些脚本.该文件的目标是自动加载一些脚本代码.
.lldbinit
was used to preload some scripts before xCode start. The goal of this file is to load some script code automatically.
许多人都推荐它,但它不起作用.我知道脚本代码是正确的,因为它适用于手动调用:
Many people recommend it but it DOESN'T WORK. I know the script code is correct because it works on manual call:
command source ~/.lldbinit
它不再起作用了吗?
我在xCode 6.4中尝试了以下简单代码:
I tried the following simple code in xCode 6.4:
expr @import UIKit
除了断点手动调用此脚本以外的解决方案吗?
Any solutions except of breakpoints calling this script manually?
推荐答案
主目录中的.lldbinit源于要调试的目标创建之前.目的是建立用于创建该目标的环境.您想将UIKit导入正在构建的表达式上下文中,以在该目标中进行执行评估.根据定义,您无法在〜/.lldbinit中完成该操作.
The .lldbinit in your home directory is sourced in BEFORE the target you are going to debug is created. It's purpose is to set up the environment for creating that target. You want to import UIKit into the expression context being built up for execution evaluation in that target. By definition you can't do that in the ~/.lldbinit.
这篇关于.lldbinit在xCode中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!