[Lldb-commits] [lldb] [LLDB] Add DIL code for handling plain variable names. (PR #120971)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 24 01:49:52 PST 2025
https://github.com/labath commented:
I think I can live with looking up global variables in the current compile unit, as it's pretty clear these are the variables that should be looked at before any other CUs/modules. We will probably want to look up those as well (bring back the FindGlobalVariables call), but I think it's much more important to reach a point where we can replace/delete the current `frame variable` implementation (and we don't need globals for that).
That said I think it would be better to fetch globals separately instead of bunching them all in one list and then filtering it out. What `GetInScopeVariableList` does when the `get_file_globals` argument is set is basically to call `CompileUnit::GetVariableList())` and append that to the result. So, I think we could just set that argument to false, and then separately call that function to get just the globals.
This will also make sure we only construct the global variables when they are actually needed. (This is an optimization that I think makes sense, since parsing a global variable is a much more complicated operation than parsing a string)
https://github.com/llvm/llvm-project/pull/120971
More information about the lldb-commits
mailing list