summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-09-18 18:59:15 +0000
committerGreg Clayton <gclayton@apple.com>2011-09-18 18:59:15 +0000
commit762f7135e290696595b6c7233245581f59eeb07c (patch)
tree212853e079493dbdcffde98869c84e1aaededfea /lldb/source/Core/Module.cpp
parent261a10a00784a426f66b8feb4c864f494ad25140 (diff)
downloadbcm5719-llvm-762f7135e290696595b6c7233245581f59eeb07c.tar.gz
bcm5719-llvm-762f7135e290696595b6c7233245581f59eeb07c.zip
Don't put modules for .o files into the global shared module list. We
used to do this because we needed to find the shared pointer for a .o file when the .o file's module was needed in a SymbolContext since the module in a symbol context was a shared pointer. Now that we are using intrusive pointers we don't have this limitation anymore since any instrusive shared pointer can be made from a pointer to an object all on its own. Also switched over to having the Module and SymbolVendor use shared pointers to their object files as had a leak on MacOSX when the SymbolVendor's object file wasn't the same as the Module's (debug info in a stand along file (dSYM file)). Now everything will correctly clean itself up when the module goes away after an executable gets rebuilt. Now we correctly get rid of .o files that are used with the DWARF with debug map executables on subsequent runs since the only shared pointer to the object files in from the DWARF symbol file debug map parser, and when the module gets replaced, it destroys to old one along with all .o files. Also added a small optimization when using BSD archives where we will remove old BSD containers from the shared list when they are outdated. llvm-svn: 140002
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 66195780020..d54f9699a49 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -68,7 +68,7 @@ Module::Module(const FileSpec& file_spec, const ArchSpec& arch, const ConstStrin
m_platform_file(),
m_object_name (),
m_object_offset (object_offset),
- m_objfile_ap (),
+ m_objfile_sp (),
m_symfile_ap (),
m_ast (),
m_did_load_objfile (false),
@@ -124,7 +124,7 @@ Module::~Module()
// here because symbol files can require the module object file. So we tear
// down the symbol file first, then the object file.
m_symfile_ap.reset();
- m_objfile_ap.reset();
+ m_objfile_sp.reset();
}
@@ -636,9 +636,9 @@ Module::GetObjectFile()
m_did_load_objfile = true;
Timer scoped_timer(__PRETTY_FUNCTION__,
"Module::GetObjectFile () module = %s", GetFileSpec().GetFilename().AsCString(""));
- m_objfile_ap.reset(ObjectFile::FindPlugin(this, &m_file, m_object_offset, m_file.GetByteSize()));
+ m_objfile_sp = ObjectFile::FindPlugin(this, &m_file, m_object_offset, m_file.GetByteSize());
}
- return m_objfile_ap.get();
+ return m_objfile_sp.get();
}
OpenPOWER on IntegriCloud