summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-04-29 17:25:54 +0000
committerGreg Clayton <gclayton@apple.com>2013-04-29 17:25:54 +0000
commitb5ad4ec7a31206227b1cd657dd41b21cc6afc98e (patch)
tree68f35ccdff9e1410bca21aeb2e216fa91d45a19f /lldb/source/Plugins/DynamicLoader
parentf1f1c626e7fcd3db60641be223308390de288a41 (diff)
downloadbcm5719-llvm-b5ad4ec7a31206227b1cd657dd41b21cc6afc98e.tar.gz
bcm5719-llvm-b5ad4ec7a31206227b1cd657dd41b21cc6afc98e.zip
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
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp10
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp30
2 files changed, 14 insertions, 26 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index a05e9e09d01..12e2174feeb 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -955,15 +955,9 @@ DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule (Process *p
s->Printf ("Kernel slid 0x%" PRIx64 " in memory.\n", m_load_address - file_address);
}
}
- if (m_module_sp->GetFileSpec().GetDirectory().IsEmpty())
{
- s->Printf ("Loaded kernel file %s\n", m_module_sp->GetFileSpec().GetFilename().AsCString());
- }
- else
- {
- s->Printf ("Loaded kernel file %s/%s\n",
- m_module_sp->GetFileSpec().GetDirectory().AsCString(),
- m_module_sp->GetFileSpec().GetFilename().AsCString());
+ s->Printf ("Loaded kernel file %s\n",
+ m_module_sp->GetFileSpec().GetPath().c_str());
}
s->Flush ();
}
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index bef86ae2ffa..94c824a8a05 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -493,11 +493,10 @@ DynamicLoaderMacOSXDYLD::UpdateImageLoadAddress (Module *module, DYLDImageInfo&
else
{
Host::SystemLog (Host::eSystemLogWarning,
- "warning: unable to find and load segment named '%s' at 0x%" PRIx64 " in '%s/%s' in macosx dynamic loader plug-in.\n",
+ "warning: unable to find and load segment named '%s' at 0x%" PRIx64 " in '%s' in macosx dynamic loader plug-in.\n",
info.segments[i].name.AsCString("<invalid>"),
(uint64_t)new_section_load_addr,
- image_object_file->GetFileSpec().GetDirectory().AsCString(),
- image_object_file->GetFileSpec().GetFilename().AsCString());
+ image_object_file->GetFileSpec().GetPath().c_str());
}
}
}
@@ -573,10 +572,9 @@ DynamicLoaderMacOSXDYLD::UnloadImageLoadAddress (Module *module, DYLDImageInfo&
else
{
Host::SystemLog (Host::eSystemLogWarning,
- "warning: unable to find and unload segment named '%s' in '%s/%s' in macosx dynamic loader plug-in.\n",
+ "warning: unable to find and unload segment named '%s' in '%s' in macosx dynamic loader plug-in.\n",
info.segments[i].name.AsCString("<invalid>"),
- image_object_file->GetFileSpec().GetDirectory().AsCString(),
- image_object_file->GetFileSpec().GetFilename().AsCString());
+ image_object_file->GetFileSpec().GetPath().c_str());
}
}
}
@@ -1440,42 +1438,38 @@ DynamicLoaderMacOSXDYLD::DYLDImageInfo::PutToLog (Log *log) const
{
if (u)
{
- log->Printf("\t modtime=0x%8.8" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s/%s' (UNLOADED)",
+ log->Printf("\t modtime=0x%8.8" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s' (UNLOADED)",
mod_date,
u[ 0], u[ 1], u[ 2], u[ 3],
u[ 4], u[ 5], u[ 6], u[ 7],
u[ 8], u[ 9], u[10], u[11],
u[12], u[13], u[14], u[15],
- file_spec.GetDirectory().AsCString(),
- file_spec.GetFilename().AsCString());
+ file_spec.GetPath().c_str());
}
else
- log->Printf("\t modtime=0x%8.8" PRIx64 " path='%s/%s' (UNLOADED)",
+ log->Printf("\t modtime=0x%8.8" PRIx64 " path='%s' (UNLOADED)",
mod_date,
- file_spec.GetDirectory().AsCString(),
- file_spec.GetFilename().AsCString());
+ file_spec.GetPath().c_str());
}
else
{
if (u)
{
- log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s/%s'",
+ log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s'",
address,
mod_date,
u[ 0], u[ 1], u[ 2], u[ 3],
u[ 4], u[ 5], u[ 6], u[ 7],
u[ 8], u[ 9], u[10], u[11],
u[12], u[13], u[14], u[15],
- file_spec.GetDirectory().AsCString(),
- file_spec.GetFilename().AsCString());
+ file_spec.GetPath().c_str());
}
else
{
- log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64 " path='%s/%s'",
+ log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64 " path='%s'",
address,
mod_date,
- file_spec.GetDirectory().AsCString(),
- file_spec.GetFilename().AsCString());
+ file_spec.GetPath().c_str());
}
for (uint32_t i=0; i<segments.size(); ++i)
OpenPOWER on IntegriCloud