llvm-project/lldb/source
Raphael Isemann bd2a910a63 Ignore generated @import statements in the expression evaluator
Summary:
The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression
wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject
`@import` statements with our std module prototype, the ClangModulesDeclVendor will start compiling
and loading unrelated C++ modules because it thinks the user has requested that it should load them. As
the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths),
it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes
these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS).

This patch fixes this by preventing the ClangModulesDeclVendor from interpreting `@import` statements
in the wrapper source code. This is done by check if the import happens in the fake source file containing
our wrapper code (which implies it was generated by LLDB).

This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760)

Reviewers: aprantl, shafik, jingham

Subscribers: lldb-commits

Tags: #c_modules_in_lldb, #lldb

Differential Revision: https://reviews.llvm.org/D61565

llvm-svn: 372690
2019-09-24 06:58:39 +00:00
..
API [lldb][NFC] Make ArgEntry::quote private and provide a getter 2019-09-13 08:26:00 +00:00
Breakpoint [lldb][NFC] Remove ArgEntry::ref member 2019-09-13 11:26:48 +00:00
Commands [lldb] Make cursor index in CompletionRequest unsigned 2019-09-23 09:46:17 +00:00
Core File::SetDescriptor() should require options 2019-09-23 20:36:46 +00:00
DataFormatters Code cleanup: Change FormattersContainer::KeyType from SP to rvalue 2019-09-04 09:47:18 +00:00
Expression [DWARF] Evaluate DW_OP_entry_value 2019-09-11 21:23:45 +00:00
Host [LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures 2019-09-23 20:43:22 +00:00
Initialization Various build fixes for lldb on MinGW 2019-08-06 18:20:43 +00:00
Interpreter [lldb][NFC] Remove unused variable in Options::HandleOptionArgumentCompletion 2019-09-23 10:02:26 +00:00
Plugins Ignore generated @import statements in the expression evaluator 2019-09-24 06:58:39 +00:00
Symbol [lldb] Fix LLDB build after r372538 2019-09-23 06:59:35 +00:00
Target File::SetDescriptor() should require options 2019-09-23 20:36:46 +00:00
Utility [LLDB] Check for _WIN32 instead of _MSC_VER for code specific to windows in general 2019-09-23 12:03:56 +00:00
CMakeLists.txt [CMake] Remove Apple-specific version logic. 2019-04-17 18:23:22 +00:00
lldb.cpp [CMake] Remove Apple-specific version logic. 2019-04-17 18:23:22 +00:00