[Lldb-commits] [lldb] [lldb] Limit DIL globals to only current file (PR #192592)

Ilia Kuklin via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 17 07:24:17 PDT 2026


kuilpd wrote:

> DIL has supported unlimited global lookup, which is in contrast with long standing `frame variable` behavior, which supports only globals in the current file.

One of the main reasons DIL came to be is that it will eventually be used in data formatters, which often need access to global variables.

> For `dwim-print`, the bug manifests as 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`.

I guess there are some differences looking up properties in Swift compared to scopes in C++? I think we should try fixing DIL to correctly handle this situation instead of banning looking up global variables, I think it's too useful to just remove.

https://github.com/llvm/llvm-project/pull/192592


More information about the lldb-commits mailing list