1

.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

Does it work no more?

I tried the following simple code in xCode 6.4:

expr @import UIKit

Any solutions except of breakpoints calling this script manually?

1 Answer 1

2

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.

5
  • ok, could you suggest a workable code I can use to check if I created this .lldbinit properly and if xcode uses it? Aug 3, 2015 at 7:12
  • probably the easiest thing to do is find some esoteric setting, check its value in xcode with "settings show whatever" then put "settings set whatever <Something other than the value above>" and stop & re-run the debugger. If your init file is getting read in, the value of the setting should have changed.
    – Jim Ingham
    Aug 3, 2015 at 23:28
  • could you post a concrete example? Because for example here they say that it works no more: stackoverflow.com/questions/31577158/… Aug 4, 2015 at 10:10
  • For instance, the setting "target.process.ignore-breakpoints-in-expressions" is true by default (which you can verify with "settings show".) So put "settings set target.process.ignore-breakpoints-in-expressions false" in the ~/.lldbinit, debug and run "settings show" again. It should now be false. Works for me in the Xcode 7. I'm not sure what was not working in the post you refer to but so far as I can tell the file is getting source in.
    – Jim Ingham
    Aug 4, 2015 at 18:29
  • maybe it is because of the limitations of xcode 6.4. I haven't a possibility to check it in xcode 7 (it requires osx 10.11) so let I simply believe you Aug 5, 2015 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.