llvm-project/lldb/bindings
Raphael Isemann c2f9454a16 [lldb] Add SBModule::GarbageCollectAllocatedModules and clear modules after each test run
Right now the only places in the SB API where lldb:: ModuleSP instances are
destroyed are in SBDebugger::MemoryPressureDetected (where it's just attempted
but not guaranteed) and in SBDebugger::DeleteTarget (which will be removed in
D83933). Tests that directly create an lldb::ModuleSP and never create a target
therefore currently leak lldb::Module instances. This triggers the sanity checks
in lldbtest that make sure that the global module list is empty after a test.

This patch adds SBModule::GarbageCollectAllocatedModules as an explicit way to
clean orphaned lldb::ModuleSP instances. Also we now start calling this method
at the end of each test run and move the sanity check behind that call to make
this work. This way even tests that don't create targets can pass the sanity
check.

This fixes TestUnicodeSymbols.py when D83865 is applied (which makes that the
sanity checks actually fail the test).

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D83876
2020-08-17 11:00:19 +02:00
..
interface [lldb] Add SBModule::GarbageCollectAllocatedModules and clear modules after each test run 2020-08-17 11:00:19 +02:00
lua [lldb] Fix relative imports and set the appropriate include dirs 2020-08-12 16:28:46 -07:00
python [lldb] Fix relative imports and set the appropriate include dirs 2020-08-12 16:28:46 -07:00
CMakeLists.txt [lldb/CMake] Separate CMake code for Lua and Python (NFC) 2020-08-11 09:04:18 -07:00
headers.swig [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC) 2020-04-30 13:41:21 -07:00
interfaces.swig [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC) 2020-04-30 13:41:21 -07:00
macros.swig