【发布时间】:2017-09-06 08:41:35
【问题描述】:
在 lldb 中打印值时,出现以下错误
error: no member named 'rec' in namespace '$__lldb_local_vars'
我的代码是由 -g 编译的。为什么 lldb 不能打印值?
【问题讨论】:
标签: lldb
在 lldb 中打印值时,出现以下错误
error: no member named 'rec' in namespace '$__lldb_local_vars'
我的代码是由 -g 编译的。为什么 lldb 不能打印值?
【问题讨论】:
标签: lldb
$__lldb_local_vars 解决了 clang 为 lldb 的表达式解析器提供的名称查找功能中的一些问题。 hack 尝试通过将局部变量注入命名空间,然后将其导入到表达式中,将局部变量提升到名称查找的头部(在本地可见类和命名空间查找之前)。这有一些性能问题,而且它也很脆弱,因为它需要实现所有可见的局部变量。我们做了很多工作来删除我们可以说我们无法实现的本地人,但它仍然不能非常可靠地工作。
Apple 发布的所有 lldb 中默认关闭此 hack,并通过设置进行控制:
(lldb) set list target.experimental.inject-local-vars
target.experimental.inject-local-vars -- If true, inject local variables explicitly into the
expression text. This will fix symbol resolution
when there are name collisions between ivars and
local variables. But it can make expressions run
much more slowly.
您可以使用settings show 显示此设置的当前值,并使用settings set 更改它。
如果您可以提供显示此故障的示例,向 llvm 错误报告者提交错误会很有帮助:https://bugs.llvm.org。
【讨论】: