This reverts commit00764c36edand the follow upd2223c7a49. The original patch broke that one could use static member variables while inside a static member functions without having a running target. It seems that LLDB currently requires that static variables are only found via the global variable lookup so that they can get materialized and mapped to the argument struct of the expression. After00764c36edstatic variables of the current class could be found via Clang's lookup which LLDB isn't observing. This resulting in expressions actually containing these variables as normal globals that can't be rewritten to a member of the argument struct. More specifically, in the test TestCPPThis, the expression `expr --j false -- s_a` is now only passing if we have a runnable target. I'll revert the patch as the possible fixes aren't trivial and it degrades the debugging experience more than the issue that the revert patch addressed. The underlying bug can be reproduced before/after this patch by stopping in `TestCPPThis` main function and running: `e -j false -- my_a; A<int>::s_a`. The `my_a` will pull in the `A<int>` class and the second expression will be resolved by Clang on its own (which causes LLDB to not materialize the static variable). Note: A workaround is to just do `::s_a` which will force LLDB to take the global variable lookup.
3.8 KiB
3.8 KiB