lldb::SBAddress
GetObjectFileEntryPointAddress() const;
+ %feature("docstring", "
+ Returns the number of modules in the module cache. This is an
+ implementation detail exposed for testing and should not be relied upon.
+
+ @return
+ The number of modules in the module cache.") GetNumberAllocatedModules;
+ static uint32_t
+ GetNumberAllocatedModules();
+
STRING_EXTENSION(SBModule)
#ifdef SWIGPYTHON
lldb::SBAddress GetObjectFileHeaderAddress() const;
lldb::SBAddress GetObjectFileEntryPointAddress() const;
+ /// Get the number of global modules.
+ static uint32_t GetNumberAllocatedModules();
+
private:
friend class SBAddress;
friend class SBFrame;
process = target.GetProcess()
if process:
rc = self.invoke(process, "Kill")
- self.assertTrue(rc.Success(), PROCESS_KILLED)
+ assert rc.Success()
for target in targets:
self.dbg.DeleteTarget(target)
+ # Modules are not orphaned during reproducer replay because they're
+ # leaked on purpose.
+ if not configuration.is_reproducer():
+ # Assert that all targets are deleted.
+ assert self.dbg.GetNumTargets() == 0
+ # Assert that the global module cache is empty.
+ assert lldb.SBModule.GetNumberAllocatedModules() == 0
+
# Do this last, to make sure it's in reverse order from how we setup.
Base.tearDown(self)
return LLDB_RECORD_RESULT(sb_addr);
}
+uint32_t SBModule::GetNumberAllocatedModules() {
+ LLDB_RECORD_STATIC_METHOD_NO_ARGS(uint32_t, SBModule,
+ GetNumberAllocatedModules);
+
+ return Module::GetNumberAllocatedModules();
+}
+
namespace lldb_private {
namespace repro {
GetObjectFileHeaderAddress, ());
LLDB_REGISTER_METHOD_CONST(lldb::SBAddress, SBModule,
GetObjectFileEntryPointAddress, ());
+ LLDB_REGISTER_STATIC_METHOD(uint32_t, SBModule, GetNumberAllocatedModules,
+ ());
}
}