xcode LLDB 似乎没有在启动时读取我的 .lldbinit 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7689735/
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
LLDB does not appear to be reading my .lldbinit file on startup
提问by William Jockusch
I have a file ~/.lldbinit with a single alias:
我有一个文件 ~/.lldbinit 和一个别名:
command alias pi print (int)
But when I run my app from Xcode, the alias does not work. However, if I manually enter the alias, then the alias does work:
但是当我从 Xcode 运行我的应用程序时,别名不起作用。但是,如果我手动输入别名,则别名确实有效:
(lldb) pi 6
error: 'pi' is not a valid command.
(lldb) command alias pi print (int)
(lldb) pi 6
(int) = 6
(lldb)
This leads me to suspect that my .lldbinit file is not getting read. Or is there a different problem that I am missing? Can anyone help?
这让我怀疑我的 .lldbinit 文件没有被读取。还是我遗漏了不同的问题?任何人都可以帮忙吗?
采纳答案by DavidPhillipOster
Note that ~/.lldbinit does work in Xcode 4.3.2, iOS.
请注意, ~/.lldbinit 在 Xcode 4.3.2、iOS 中确实有效。
回答by MatzeBraun
I had a similar problem. It turned out, that I had a syntax error in my .lldbinit file which leads to lldb silently ignoring the file. You can try manually loading the file with
我有一个类似的问题。事实证明,我的 .lldbinit 文件中有一个语法错误,导致 lldb 默默地忽略了该文件。您可以尝试手动加载文件
command source ~/.lldbinit
which will show syntax errors.
这将显示语法错误。
回答by Ed McManus
Make the file executable:
使文件可执行:
chmod +x ~/.lldbinit
回答by Michael Dautermann
I created a .llbdbinit file just like you and reproduced your problem in my copy of XCode 4.1. I can't get aliases to work either.
我像您一样创建了一个 .llbdbinit 文件,并在我的 XCode 4.1 副本中重现了您的问题。我也无法使用别名。
Since ~/.lldbinit is documented by Appleas supposedly being read when started up, I suspect that lldbinit file reading is currently busted in shipping versions of XCode 4. Not sure what pre-release versions are doing, but I'd recommend filing a bug at bugreporter.apple.com.
由于 ~/.lldbinit被 Apple 记录为在启动时被读取,我怀疑 lldbinit 文件读取目前在 XCode 4 的发布版本中被破坏。不确定预发布版本在做什么,但我建议提交一份bugreporter.apple.com 上的错误。
p.s.
ps
One thing I noticed on one blog (here; look in the "differences between OSX & iOS" section) is that lldb only works for MacOS and NOTfor iOS, at least as of a bunch of months ago.
有一件事我在一个博客注意到了(在这里,看在节中的“OSX和iOS之间的差异”)是LLDB仅适用于MacOS和不适用于iOS,至少一堆个月前。
回答by brian.clear
I had the same problem when trying to get this pluginto work.
我在尝试让这个插件工作时遇到了同样的问题。
command script import ~/Documents/002.ME/001.BITBUCKET_REPO/xcode_plugin_lldb_quicklook/GITHUB-LLDB-QuickLook/LLDB-QuickLook/lldb_quick_look.py
command alias ql quicklook
The path to the py file was wrong so kept reporting the error:
py文件的路径不对所以一直报错:
error: 'ql' is not a valid command.
error: 'ql' is not a valid command.
Once I fixed it. I had to restart XCode 5 and it worked.
一旦我修好了。我不得不重新启动 XCode 5 并且它起作用了。
I didn't have to restart Mac.
我不必重新启动 Mac。
I didn't have to make the file executable.
我不必使文件可执行。
回答by anuj
if you created the lldbinit file with some editor then it might have screwed it. try openning the lldbinit file with vi and check if it just plain text
如果您使用某个编辑器创建了 lldbinit 文件,那么它可能已经搞砸了。尝试用 vi 打开 lldbinit 文件并检查它是否只是纯文本

