llvm-project/lldb/unittests/Expression
Raphael Isemann 99b7b41edf [lldb][import-std-module] Do some basic file checks before trying to import a module
Currently when LLDB has enough data in the debug information to import the `std` module,
it will just try to import it. However when debugging libraries where the sources aren't
available anymore, importing the module will generate a confusing diagnostic that
the module couldn't be built.

For the fallback mode (where we retry failed expressions with the loaded module), this
will cause the second expression to fail with a module built error instead of the
actual parsing issue in the user expression.

This patch adds checks that ensures that we at least have any source files in the found
include paths before we try to import the module. This prevents the module from being
loaded in the situation described above which means we don't emit the bogus 'can't
import module' diagnostic and also don't waste any time retrying the expression in the
fallback mode.

For the unit tests I did some refactoring as they now require a VFS with the files in it
and not just the paths. The Python test just builds a binary with a fake C++ module,
then deletes the module before debugging.

Fixes rdar://73264458

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D95096
2021-01-21 12:32:51 +01:00
..
CMakeLists.txt [lldb/cmake] Fix testing support library dependencies 2020-09-15 13:32:08 +02:00
ClangExpressionDeclMapTest.cpp [lldb][NFC] Move NameSearchContext to own header/source files 2020-02-25 12:25:36 +01:00
ClangParserTest.cpp fix lldb test on lib64 systems 2020-08-03 11:19:07 +02:00
CppModuleConfigurationTest.cpp [lldb][import-std-module] Do some basic file checks before trying to import a module 2021-01-21 12:32:51 +01:00
DWARFExpressionTest.cpp [lldb/DWARF] Fix sizes of DW_OP_const[1248][us] and DW_OP_litN results 2020-11-10 16:10:08 +01:00
DiagnosticManagerTest.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00