Files
llvm-project/lldb/source/Commands/CommandObjectDWIMPrint.cpp
Dave Lee b0fe500e78 [lldb] Make global lookup in DIL configurable by caller (#192592)
DIL has supported unlimited global lookup, which is in contrast with
long standing `frame variable` behavior, which supports only globals
from the current file.

This is semantically incorrect for frame variable, and has shown to
produce bugs in `dwim-print`. For these reasons, this change makes
global lookup opt-out, controlled by a new
`eExpressionPathOptionsDisallowGlobals` flag.

For `dwim-print`, the bug manifests when a global shadows a computed
property of the instance variable (`self`). As an example, if a global
named `text` exists, and a property named `text` exists (ie
`self.text`), then running `dwim-print text` will unexpectedly print the
global, not `self.text`.

rdar://174834020

Assisted-by: claude
2026-04-21 12:22:24 -07:00

9.9 KiB