forked from OSchip/llvm-project
8184b252cd
This patch adds support for evaluating expressions which reference a captured `this` from within the context of a C++ lambda expression. Currently LLDB doesn't provide Clang with enough information to determine that we're inside a lambda expression and are allowed to access variables on a captured `this`; instead Clang simply fails to parse the expression. There are two problems to solve here: 1. Make sure `clang::Sema` doesn't reject the expression due to an illegal member access. 2. Materialize all the captured variables/member variables required to evaluate the expression. To address (1), we currently import the outer structure's AST context onto `$__lldb_class`, making the `contextClass` and the `NamingClass` match, a requirement by `clang::Sema::BuildPossibleImplicitMemberExpr`. To address (2), we inject all captured variables as locals into the expression source code. **Testing** * Added API test |
||
---|---|---|
.. | ||
API | ||
Breakpoint | ||
Core | ||
DataFormatters | ||
Expression | ||
Host | ||
Initialization | ||
Interpreter | ||
Symbol | ||
Target | ||
Utility | ||
Version | ||
lldb-defines.h | ||
lldb-enumerations.h | ||
lldb-forward.h | ||
lldb-private-defines.h | ||
lldb-private-enumerations.h | ||
lldb-private-forward.h | ||
lldb-private-interfaces.h | ||
lldb-private-types.h | ||
lldb-private.h | ||
lldb-public.h | ||
lldb-types.h | ||
lldb-versioning.h | ||
module.modulemap |