<rdar://problem/12639603>

Simplify the logging on ObjectFile::~ObjectFile() to not access an classes above the object file (like the module) so we don't crash when logging object lifetimes. The log message contains the "this" pointer value which can be matched up with the constructor log.

llvm-svn: 168754
This commit is contained in:
Greg Clayton
2012-11-28 00:44:24 +00:00
parent 7875088078
commit e9adcab0a1

View File

@@ -218,29 +218,7 @@ ObjectFile::~ObjectFile()
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
if (log)
{
ModuleSP module_sp (GetModule());
if (m_file)
{
log->Printf ("%p ObjectFile::~ObjectFile () module = %s/%s, file = %s/%s, offset = 0x%8.8llx, size = %llu\n",
this,
module_sp->GetFileSpec().GetDirectory().AsCString(),
module_sp->GetFileSpec().GetFilename().AsCString(),
m_file.GetDirectory().AsCString(),
m_file.GetFilename().AsCString(),
m_offset,
m_length);
}
else
{
log->Printf ("%p ObjectFile::~ObjectFile () module = %s/%s, file = <NULL>, offset = 0x%8.8llx, size = %llu\n",
this,
module_sp->GetFileSpec().GetDirectory().AsCString(),
module_sp->GetFileSpec().GetFilename().AsCString(),
m_offset,
m_length);
}
}
log->Printf ("%p ObjectFile::~ObjectFile ()\n", this);
}
bool