llvm-project/lldb/bindings/interface
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
..
SBAddress.i [lldb/Bindings] Raise exception when using properties that rely on lldb.target 2020-05-29 22:11:21 -07:00
SBAttachInfo.i
SBBlock.i [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
SBBreakpoint.i [lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI) 2020-07-01 12:45:05 +02:00
SBBreakpointLocation.i
SBBreakpointName.i
SBBroadcaster.i
SBCommandInterpreter.i [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC) 2020-04-30 13:41:21 -07:00
SBCommandInterpreterRunOptions.i [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC) 2020-04-30 13:41:21 -07:00
SBCommandReturnObject.i
SBCommunication.i
SBCompileUnit.i
SBData.i
SBDebugger.i
SBDeclaration.i
SBEnvironment.i Create basic SBEnvironment class 2020-03-23 19:23:33 -07:00
SBError.i
SBEvent.i
SBExecutionContext.i
SBExpressionOptions.i [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
SBFile.i [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
SBFileSpec.i
SBFileSpecList.i
SBFrame.i
SBFunction.i
SBHostOS.i
SBInstruction.i
SBInstructionList.i
SBLanguageRuntime.i
SBLaunchInfo.i Create basic SBEnvironment class 2020-03-23 19:23:33 -07:00
SBLineEntry.i
SBListener.i
SBMemoryRegionInfo.i
SBMemoryRegionInfoList.i
SBModule.i [lldb] Add SBModule::GarbageCollectAllocatedModules and clear modules after each test run 2020-08-17 11:00:19 +02:00
SBModuleSpec.i
SBPlatform.i Create basic SBEnvironment class 2020-03-23 19:23:33 -07:00
SBProcess.i [lldb/Plugins] Move SBTarget::GetExtendedCrashInformation to SBProcess 2020-02-24 23:37:04 +01:00
SBProcessInfo.i
SBQueue.i
SBQueueItem.i
SBReproducer.i [lldb/Reproducers] Add test-specific API to set the test CWD 2020-05-13 09:00:07 -07:00
SBSection.i
SBSourceManager.i
SBStream.i [lldb/Reproducers] Make SBStream::Print an API instead of a SWIG extension 2020-05-20 10:37:18 -07:00
SBStringList.i
SBStructuredData.i
SBSymbol.i
SBSymbolContext.i
SBSymbolContextList.i
SBTarget.i Create basic SBEnvironment class 2020-03-23 19:23:33 -07:00
SBThread.i
SBThreadCollection.i
SBThreadPlan.i Add a setting to force stepping to always run all threads. 2020-08-07 14:47:31 -07:00
SBTrace.i
SBTraceOptions.i
SBType.i
SBTypeCategory.i
SBTypeEnumMember.i Add python enumerators for SBTypeEnumMemberList, and some tests for this API. 2020-08-14 09:57:46 -07:00
SBTypeFilter.i
SBTypeFormat.i
SBTypeNameSpecifier.i
SBTypeSummary.i
SBTypeSynthetic.i
SBUnixSignals.i
SBValue.i
SBValueList.i
SBVariablesOptions.i
SBWatchpoint.i