Cleanup logging to use the new "std::string FileSpec::GetPath()" function. Also added a similar function for modules:

std::string
Module::GetSpecificationDescription () const;

This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it.

llvm-svn: 180717
This commit is contained in:
Greg Clayton
2013-04-29 17:25:54 +00:00
parent f1f1c626e7
commit b5ad4ec7a3
33 changed files with 185 additions and 275 deletions

View File

@@ -59,13 +59,9 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa
if (log)
{
ConstString object_name (oso_module->GetObjectName());
log->Printf("%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s/%s%s%s%s')",
log->Printf("%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')",
this,
oso_module->GetFileSpec().GetDirectory().GetCString(),
oso_module->GetFileSpec().GetFilename().GetCString(),
object_name ? "(" : "",
object_name ? object_name.GetCString() : "",
object_name ? ")" : "");
oso_module->GetSpecificationDescription().c_str());
}
@@ -1415,10 +1411,9 @@ SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (CompileUnitInfo *cu_info)
#if defined(DEBUG_OSO_DMAP)
const FileRangeMap &oso_file_range_map = cu_info->GetFileRangeMap(this);
const size_t n = oso_file_range_map.GetSize();
printf ("SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s/%s\n",
printf ("SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s\n",
cu_info,
cu_info->oso_sp->module_sp->GetFileSpec().GetDirectory().GetCString(),
cu_info->oso_sp->module_sp->GetFileSpec().GetFilename().GetCString());
cu_info->oso_sp->module_sp->GetFileSpec().GetPath().c_str());
for (size_t i=0; i<n; ++i)
{
const FileRangeMap::Entry &entry = oso_file_range_map.GetEntryRef(i);