LLDB 在启动时似乎没有读取我的 .lldbinit 文件

发布于 2024-12-08 11:32:19 字数 344 浏览 0 评论 0原文

我有一个带有单个别名的文件 ~/.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

好久不见√ 2024-12-15 11:32:19

我有类似的问题。事实证明,我的 .lldbinit 文件中有一个语法错误,导致 lldb 默默地忽略该文件。 文件。

command source ~/.lldbinit

您可以尝试手动加载将显示语法错误的

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

command source ~/.lldbinit

which will show syntax errors.

月隐月明月朦胧 2024-12-15 11:32:19

使文件可执行:

chmod +x ~/.lldbinit

Make the file executable:

chmod +x ~/.lldbinit
把时间冻结 2024-12-15 11:32:19

我像您一样创建了一个 .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.

杀手六號 2024-12-15 11:32:19

请注意,~/.lldbinit 在 Xcode 4.3.2、iOS 中有效。

Note that ~/.lldbinit does work in Xcode 4.3.2, iOS.

划一舟意中人 2024-12-15 11:32:19

如果您使用某些编辑器创建了 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

勿挽旧人 2024-12-15 11:32:19

当我试图让这个插件工作时,我遇到了同样的问题。

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

py文件的路径错误所以一直报错:

error: 'ql' is not a valid command.

一旦我修复了它。我必须重新启动 Xcode 5 并且它起作用了。

我不必重新启动 Mac。

我不必使该文件可执行。

I had the same problem when trying to get this plugin to 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:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文