LLDB 在启动时似乎没有读取我的 .lldbinit 文件
我有一个带有单个别名的文件 ~/.lldbinit:
command alias pi print (int)
但是当我从 Xcode 运行我的应用程序时,别名不起作用。但是,如果我手动输入别名,则别名确实有效:
(lldb) pi 6
error: 'pi' is not a valid command.
(lldb) command alias pi print (int)
(lldb) pi 6
(int) $3 = 6
(lldb)
这使我怀疑我的 .lldbinit 文件没有被读取。或者我遗漏了其他问题?有人可以帮忙吗?
I have a file ~/.lldbinit with a single alias:
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:
(lldb) pi 6
error: 'pi' is not a valid command.
(lldb) command alias pi print (int)
(lldb) pi 6
(int) $3 = 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我有类似的问题。事实证明,我的 .lldbinit 文件中有一个语法错误,导致 lldb 默默地忽略该文件。 文件。
您可以尝试手动加载将显示语法错误的
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
which will show syntax errors.
使文件可执行:
Make the file executable:
我像您一样创建了一个 .llbdbinit 文件,并在我的 Xcode 4.1 副本中重现了您的问题。我也无法使用别名。
由于 ~/.lldbinit 是据 Apple 记录,据称在启动时会被读取,我怀疑 lldbinit 文件读取当前在 Xcode 4 的发布版本中被破坏。不确定预发行版本正在做什么,但我建议在以下位置提交错误bugreporter.apple.com。
ps
我在一篇博客上注意到一件事(此处;查看“OSX 与 iOS 之间的差异”部分),lldb 仅适用于 MacOS,不适用于 iOS,至少是这样。几个月前的事。
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.
Since ~/.lldbinit is documented by Apple as 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.
p.s.
One thing I noticed on one blog (here; look in the "differences between OSX & iOS" section) is that lldb only works for MacOS and NOT for iOS, at least as of a bunch of months ago.
请注意,~/.lldbinit 在 Xcode 4.3.2、iOS 中有效。
Note that ~/.lldbinit does work in Xcode 4.3.2, iOS.
如果您使用某些编辑器创建了 lldbinit 文件,那么它可能会搞砸。
尝试使用 vi 打开 lldbinit 文件并检查它是否只是纯文本
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
当我试图让这个插件工作时,我遇到了同样的问题。
py文件的路径错误所以一直报错:
error: 'ql' is not a valid command.
一旦我修复了它。我必须重新启动 Xcode 5 并且它起作用了。
我不必重新启动 Mac。
我不必使该文件可执行。
I had the same problem when trying to get this plugin to work.
The path to the py file was wrong so kept reporting the error:
error: 'ql' is not a valid command.
Once I fixed it. I had to restart Xcode 5 and it worked.
I didn't have to restart Mac.
I didn't have to make the file executable.