llvm-project/lldb/unittests
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
..
API [lldb] Get rid of helper CMake variables for Python 2020-08-17 08:47:52 -07:00
Breakpoint [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Core [lldb/Module] Allow for the creation of memory-only modules 2020-07-14 08:45:44 -07:00
DataFormatter Reland [lldb] Unify type name matching in FormattersContainer II 2020-07-23 18:17:42 +02:00
Disassembler [lldb/Plugins] Rename lldbPluginDisassemblerLLVM (NFC) 2020-02-17 19:14:01 -08:00
Editline [lldb] Modernize PseudoTerminal::OpenSecondary 2020-10-16 15:22:55 +02:00
Expression [lldb][import-std-module] Do some basic file checks before trying to import a module 2021-01-21 12:32:51 +01:00
Host [lldb] Disable PipeTest.OpenAsReader on windows 2021-01-11 13:37:49 +01:00
Instruction Fix UB in EmulateInstructionARM64.cpp 2020-06-01 18:11:50 -07:00
Interpreter [lldb] Make TestOptionValueFileColonLine work on Windows 2020-07-20 23:15:03 -07:00
Language [lldb] Reactivate Objective-C++ plugin 2020-06-19 19:16:46 +02:00
ObjectFile [lldb/ObjectFileMachO] Fetch shared cache images from our own shared cache 2020-07-16 10:37:37 -07:00
Platform Factor out common code from the iPhone/AppleTV/WatchOS simulator platform plugins. (NFC) 2020-08-06 16:36:58 -07:00
Process [LLDB] MinidumpParser: Prefer executable module even at higher address 2021-01-14 13:17:57 -05:00
ScriptInterpreter [LLDB/Lua] add support for one-liner breakpoint callback 2020-11-30 14:12:26 +00:00
Signals [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol [lldb] Unify the two CreateTypedef implementations in TypeSystemClang 2020-12-17 10:49:26 +01:00
SymbolFile [lldb] Fix XcodeSDKModuleTests 2020-10-30 23:08:35 -07:00
Target [lldb] Store StackFrameRecognizers in the target instead of a global list 2020-07-17 09:26:27 +02:00
TestingSupport Fix an embarrasing use-after-free from a895a446bc 2020-10-30 16:54:24 +01:00
Thread [lldb] "target create" shouldn't save target if the command failed 2020-12-12 16:40:58 +03:00
UnwindAssembly Bug where insn-based unwind plans on arm64 could be wrong 2020-04-14 16:57:25 -07:00
Utility [lldb] Deal gracefully with concurrency in the API instrumentation. 2020-12-10 09:37:49 -08:00
debugserver [lldb] Fix -Wformat warning in debugserver unit test 2020-12-08 20:57:51 -08:00
tools Make offset field optional in RegisterInfo packet for Arm64 2020-12-02 03:19:43 +05:00
CMakeLists.txt Reapply "Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories." 2020-07-22 17:50:19 -07:00
gtest_common.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00