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.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180717 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp
index e673a0a..85bece8 100644
--- a/source/API/SBModule.cpp
+++ b/source/API/SBModule.cpp
@@ -139,12 +139,10 @@
if (log)
{
- log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s%s%s)) => %i",
+ log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i",
module_sp.get(),
platform_file.get(),
- platform_file->GetDirectory().GetCString(),
- platform_file->GetDirectory() ? "/" : "",
- platform_file->GetFilename().GetCString(),
+ platform_file->GetPath().c_str(),
result);
}
return result;
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index a0b25c4..6234378 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -721,24 +721,20 @@
{
if (sc.comp_unit)
{
- s.Printf ("Global variables for %s/%s in %s/%s:\n",
- sc.comp_unit->GetDirectory().GetCString(),
- sc.comp_unit->GetFilename().GetCString(),
- sc.module_sp->GetFileSpec().GetDirectory().GetCString(),
- sc.module_sp->GetFileSpec().GetFilename().GetCString());
+ s.Printf ("Global variables for %s in %s:\n",
+ sc.comp_unit->GetPath().c_str(),
+ sc.module_sp->GetFileSpec().GetPath().c_str());
}
else
{
- s.Printf ("Global variables for %s/%s\n",
- sc.module_sp->GetFileSpec().GetDirectory().GetCString(),
- sc.module_sp->GetFileSpec().GetFilename().GetCString());
+ s.Printf ("Global variables for %s\n",
+ sc.module_sp->GetFileSpec().GetPath().c_str());
}
}
else if (sc.comp_unit)
{
- s.Printf ("Global variables for %s/%s\n",
- sc.comp_unit->GetDirectory().GetCString(),
- sc.comp_unit->GetFilename().GetCString());
+ s.Printf ("Global variables for %s\n",
+ sc.comp_unit->GetPath().c_str());
}
for (uint32_t i=0; i<count; ++i)
@@ -858,9 +854,8 @@
if (frame)
{
if (comp_unit)
- result.AppendErrorWithFormat ("no global variables in current compile unit: %s/%s\n",
- comp_unit->GetDirectory().GetCString(),
- comp_unit->GetFilename().GetCString());
+ result.AppendErrorWithFormat ("no global variables in current compile unit: %s\n",
+ comp_unit->GetPath().c_str());
else
result.AppendErrorWithFormat ("no debug information for frame %u\n", frame->GetFrameIndex());
}
@@ -899,10 +894,8 @@
else
{
// Didn't find matching shlib/module in target...
- result.AppendErrorWithFormat ("target doesn't contain the specified shared library: %s%s%s\n",
- module_file.GetDirectory().GetCString(),
- module_file.GetDirectory() ? "/" : "",
- module_file.GetFilename().GetCString());
+ result.AppendErrorWithFormat ("target doesn't contain the specified shared library: %s\n",
+ module_file.GetPath().c_str());
}
}
}
@@ -1469,11 +1462,9 @@
SectionList *section_list = objfile->GetSectionList();
if (section_list)
{
- strm.PutCString ("Sections for '");
- strm << module->GetFileSpec();
- if (module->GetObjectName())
- strm << '(' << module->GetObjectName() << ')';
- strm.Printf ("' (%s):\n", module->GetArchitecture().GetArchitectureName());
+ strm.Printf ("Sections for '%s' (%s):\n",
+ module->GetSpecificationDescription().c_str(),
+ module->GetArchitecture().GetArchitectureName());
strm.IndentMore();
section_list->Dump(&strm, interpreter.GetExecutionContext().GetTargetPtr(), true, UINT32_MAX);
strm.IndentLess();
@@ -2645,19 +2636,16 @@
{
if (module_spec.GetSymbolFileSpec())
{
- result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s with path %s/%s and symbol file %s/%s",
+ result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s with path %s and symbol file %s",
strm.GetString().c_str(),
- module_spec.GetFileSpec().GetDirectory().GetCString(),
- module_spec.GetFileSpec().GetFilename().GetCString(),
- module_spec.GetSymbolFileSpec().GetDirectory().GetCString(),
- module_spec.GetSymbolFileSpec().GetFilename().GetCString());
+ module_spec.GetFileSpec().GetPath().c_str(),
+ module_spec.GetSymbolFileSpec().GetPath().c_str());
}
else
{
- result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s with path %s/%s",
+ result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s with path %s",
strm.GetString().c_str(),
- module_spec.GetFileSpec().GetDirectory().GetCString(),
- module_spec.GetFileSpec().GetFilename().GetCString());
+ module_spec.GetFileSpec().GetPath().c_str());
}
}
else
@@ -4333,10 +4321,9 @@
{
// Provide feedback that the symfile has been successfully added.
const FileSpec &module_fs = module_sp->GetFileSpec();
- result.AppendMessageWithFormat("symbol file '%s' has been added to '%s/%s'\n",
+ result.AppendMessageWithFormat("symbol file '%s' has been added to '%s'\n",
symfile_path,
- module_fs.GetDirectory().AsCString(),
- module_fs.GetFilename().AsCString());
+ module_fs.GetPath().c_str());
// Let clients know something changed in the module
// if it is currently loaded
diff --git a/source/Core/DataBufferMemoryMap.cpp b/source/Core/DataBufferMemoryMap.cpp
index f52072b..a4382a0 100644
--- a/source/Core/DataBufferMemoryMap.cpp
+++ b/source/Core/DataBufferMemoryMap.cpp
@@ -113,9 +113,8 @@
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP));
if (log)
{
- log->Printf("DataBufferMemoryMap::MemoryMapFromFileSpec(file=\"%s/%s\", offset=0x%" PRIx64 ", length=0x%" PRIx64 ", writeable=%i",
- filespec->GetDirectory().GetCString(),
- filespec->GetFilename().GetCString(),
+ log->Printf("DataBufferMemoryMap::MemoryMapFromFileSpec(file=\"%s\", offset=0x%" PRIx64 ", length=0x%" PRIx64 ", writeable=%i",
+ filespec->GetPath().c_str(),
offset,
length,
writeable);
diff --git a/source/Core/FileLineResolver.cpp b/source/Core/FileLineResolver.cpp
index 59a875c..15cbbe6 100644
--- a/source/Core/FileLineResolver.cpp
+++ b/source/Core/FileLineResolver.cpp
@@ -90,10 +90,8 @@
void
FileLineResolver::GetDescription (Stream *s)
{
- s->Printf ("File and line resolver for file: \"%s%s%s\" line: %u",
- m_file_spec.GetDirectory().GetCString(),
- m_file_spec.GetDirectory() ? "/" : "",
- m_file_spec.GetFilename().GetCString(),
+ s->Printf ("File and line resolver for file: \"%s\" line: %u",
+ m_file_spec.GetPath().c_str(),
m_line_number);
}
diff --git a/source/Core/Module.cpp b/source/Core/Module.cpp
index 3408d7f..7f40347 100644
--- a/source/Core/Module.cpp
+++ b/source/Core/Module.cpp
@@ -156,11 +156,10 @@
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES));
if (log)
- log->Printf ("%p Module::Module((%s) '%s/%s%s%s%s')",
+ log->Printf ("%p Module::Module((%s) '%s%s%s%s')",
this,
m_arch.GetArchitectureName(),
- m_file.GetDirectory().AsCString(""),
- m_file.GetFilename().AsCString(""),
+ m_file.GetPath().c_str(),
m_object_name.IsEmpty() ? "" : "(",
m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
m_object_name.IsEmpty() ? "" : ")");
@@ -201,11 +200,10 @@
m_object_name = *object_name;
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES));
if (log)
- log->Printf ("%p Module::Module((%s) '%s/%s%s%s%s')",
+ log->Printf ("%p Module::Module((%s) '%s%s%s%s')",
this,
m_arch.GetArchitectureName(),
- m_file.GetDirectory().AsCString(""),
- m_file.GetFilename().AsCString(""),
+ m_file.GetPath().c_str(),
m_object_name.IsEmpty() ? "" : "(",
m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
m_object_name.IsEmpty() ? "" : ")");
@@ -224,11 +222,10 @@
}
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES));
if (log)
- log->Printf ("%p Module::~Module((%s) '%s/%s%s%s%s')",
+ log->Printf ("%p Module::~Module((%s) '%s%s%s%s')",
this,
m_arch.GetArchitectureName(),
- m_file.GetDirectory().AsCString(""),
- m_file.GetFilename().AsCString(""),
+ m_file.GetPath().c_str(),
m_object_name.IsEmpty() ? "" : "(",
m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
m_object_name.IsEmpty() ? "" : ")");
@@ -511,10 +508,8 @@
{
Mutex::Locker locker (m_mutex);
Timer scoped_timer(__PRETTY_FUNCTION__,
- "Module::ResolveSymbolContextForFilePath (%s%s%s:%u, check_inlines = %s, resolve_scope = 0x%8.8x)",
- file_spec.GetDirectory().AsCString(""),
- file_spec.GetDirectory() ? "/" : "",
- file_spec.GetFilename().AsCString(""),
+ "Module::ResolveSymbolContextForFilePath (%s:%u, check_inlines = %s, resolve_scope = 0x%8.8x)",
+ file_spec.GetPath().c_str(),
line,
check_inlines ? "yes" : "no",
resolve_scope);
@@ -844,6 +839,19 @@
return m_arch;
}
+std::string
+Module::GetSpecificationDescription () const
+{
+ std::string spec(GetFileSpec().GetPath());
+ if (m_object_name)
+ {
+ spec += '(';
+ spec += m_object_name.GetCString();
+ spec += ')';
+ }
+ return spec;
+}
+
void
Module::GetDescription (Stream *s, lldb::DescriptionLevel level)
{
@@ -1007,9 +1015,8 @@
Mutex::Locker locker (m_mutex);
//s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
- s->Printf("Module %s/%s%s%s%s\n",
- m_file.GetDirectory().AsCString(),
- m_file.GetFilename().AsCString(),
+ s->Printf("Module %s%s%s%s\n",
+ m_file.GetPath().c_str(),
m_object_name ? "(" : "",
m_object_name ? m_object_name.GetCString() : "",
m_object_name ? ")" : "");
diff --git a/source/Core/ModuleList.cpp b/source/Core/ModuleList.cpp
index 23cad43..ff5d225 100644
--- a/source/Core/ModuleList.cpp
+++ b/source/Core/ModuleList.cpp
@@ -658,13 +658,12 @@
Module *module = pos->get();
module->GetUUID().GetAsCString (uuid_cstr, sizeof(uuid_cstr));
const FileSpec &module_file_spec = module->GetFileSpec();
- log->Printf ("%s[%u] %s (%s) \"%s/%s\"",
+ log->Printf ("%s[%u] %s (%s) \"%s\"",
prefix_cstr ? prefix_cstr : "",
(uint32_t)std::distance (begin, pos),
uuid_cstr,
module->GetArchitecture().GetArchitectureName(),
- module_file_spec.GetDirectory().GetCString(),
- module_file_spec.GetFilename().GetCString());
+ module_file_spec.GetPath().c_str());
}
}
}
diff --git a/source/Core/Value.cpp b/source/Core/Value.cpp
index f529809..fda84e7 100644
--- a/source/Core/Value.cpp
+++ b/source/Core/Value.cpp
@@ -494,18 +494,14 @@
if (module)
{
if (variable)
- error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " for variable '%s' in %s%s%s",
+ error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " for variable '%s' in %s",
address,
variable->GetName().AsCString(""),
- module->GetFileSpec().GetDirectory().GetCString(),
- module->GetFileSpec().GetDirectory() ? "/" : "",
- module->GetFileSpec().GetFilename().GetCString());
+ module->GetFileSpec().GetPath().c_str());
else
- error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " in %s%s%s",
+ error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " in %s",
address,
- module->GetFileSpec().GetDirectory().GetCString(),
- module->GetFileSpec().GetDirectory() ? "/" : "",
- module->GetFileSpec().GetFilename().GetCString());
+ module->GetFileSpec().GetPath().c_str());
}
else
{
diff --git a/source/Host/macosx/Host.mm b/source/Host/macosx/Host.mm
index ef9348e..b60dd21 100644
--- a/source/Host/macosx/Host.mm
+++ b/source/Host/macosx/Host.mm
@@ -502,9 +502,8 @@
if (!darwin_debug_file_spec.Exists())
{
- error.SetErrorStringWithFormat ("the 'darwin-debug' executable doesn't exists at %s/%s",
- darwin_debug_file_spec.GetDirectory().GetCString(),
- darwin_debug_file_spec.GetFilename().GetCString());
+ error.SetErrorStringWithFormat ("the 'darwin-debug' executable doesn't exists at '%s'",
+ darwin_debug_file_spec.GetPath().c_str());
return error;
}
diff --git a/source/Interpreter/OptionValueFileSpec.cpp b/source/Interpreter/OptionValueFileSpec.cpp
index c1bcae2..e56b48b 100644
--- a/source/Interpreter/OptionValueFileSpec.cpp
+++ b/source/Interpreter/OptionValueFileSpec.cpp
@@ -64,17 +64,7 @@
if (m_current_value)
{
- if (m_current_value.GetDirectory())
- {
- strm << '"' << m_current_value.GetDirectory();
- if (m_current_value.GetFilename())
- strm << '/' << m_current_value.GetFilename();
- strm << '"';
- }
- else
- {
- strm << '"' << m_current_value.GetFilename() << '"';
- }
+ strm << '"' << m_current_value.GetPath().c_str() << '"';
}
}
}
diff --git a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index a05e9e0..12e2174 100644
--- a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -955,15 +955,9 @@
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/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index bef86ae..94c824a 100644
--- a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -493,11 +493,10 @@
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 @@
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 @@
{
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)
diff --git a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 2ca17e5..a5e87fc 100644
--- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -286,9 +286,8 @@
if (file && data_sp && ObjectContainerBSDArchive::MagicBytesMatch(data))
{
Timer scoped_timer (__PRETTY_FUNCTION__,
- "ObjectContainerBSDArchive::CreateInstance (module = %s/%s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
- module_sp->GetFileSpec().GetDirectory().AsCString(),
- module_sp->GetFileSpec().GetFilename().AsCString(),
+ "ObjectContainerBSDArchive::CreateInstance (module = %s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
+ module_sp->GetFileSpec().GetPath().c_str(),
file, (uint64_t) file_offset, (uint64_t) length);
// Map the entire .a file to be sure that we don't lose any data if the file
diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 7bd6020..b94ebca 100644
--- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1916,11 +1916,10 @@
// string values should have an offset zero which points
// to an empty C-string
Host::SystemLog (Host::eSystemLogError,
- "error: DSC unmapped local symbol[%u] has invalid string table offset 0x%x in %s/%s, ignoring symbol\n",
+ "error: DSC unmapped local symbol[%u] has invalid string table offset 0x%x in %s, ignoring symbol\n",
entry_index,
nlist.n_strx,
- module_sp->GetFileSpec().GetDirectory().GetCString(),
- module_sp->GetFileSpec().GetFilename().GetCString());
+ module_sp->GetFileSpec().GetPath().c_str());
continue;
}
if (symbol_name[0] == '\0')
@@ -2653,11 +2652,10 @@
// string values should have an offset zero which points
// to an empty C-string
Host::SystemLog (Host::eSystemLogError,
- "error: symbol[%u] has invalid string table offset 0x%x in %s/%s, ignoring symbol\n",
+ "error: symbol[%u] has invalid string table offset 0x%x in %s, ignoring symbol\n",
nlist_idx,
nlist.n_strx,
- module_sp->GetFileSpec().GetDirectory().GetCString(),
- module_sp->GetFileSpec().GetFilename().GetCString());
+ module_sp->GetFileSpec().GetPath().c_str());
continue;
}
if (symbol_name[0] == '\0')
diff --git a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index f6cd4c2..07846c8 100644
--- a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -232,10 +232,8 @@
if (!exe_module_sp || exe_module_sp->GetObjectFile() == NULL)
{
exe_module_sp.reset();
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain the architecture %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
+ exe_file.GetPath().c_str(),
exe_arch.GetArchitectureName());
}
}
@@ -269,10 +267,8 @@
if (error.Fail() || !exe_module_sp)
{
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
+ exe_file.GetPath().c_str(),
GetShortPluginName(),
arch_names.GetString().c_str());
}
@@ -280,10 +276,8 @@
}
else
{
- error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""));
+ error.SetErrorStringWithFormat ("'%s' does not exist",
+ exe_file.GetPath().c_str());
}
return error;
diff --git a/source/Plugins/Platform/Linux/PlatformLinux.cpp b/source/Plugins/Platform/Linux/PlatformLinux.cpp
index f388636..1078a23 100644
--- a/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -206,10 +206,8 @@
if (!exe_module_sp || exe_module_sp->GetObjectFile() == NULL)
{
exe_module_sp.reset();
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain the architecture %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
+ exe_file.GetPath().c_str(),
exe_arch.GetArchitectureName());
}
}
@@ -242,10 +240,8 @@
if (error.Fail() || !exe_module_sp)
{
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
+ exe_file.GetPath().c_str(),
GetShortPluginName(),
arch_names.GetString().c_str());
}
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index fc37885..b3775d4 100644
--- a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -196,10 +196,8 @@
if (error.Fail() || exe_module_sp.get() == NULL || exe_module_sp->GetObjectFile() == NULL)
{
exe_module_sp.reset();
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain the architecture %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
+ exe_file.GetPath().c_str(),
exe_arch.GetArchitectureName());
}
}
@@ -232,10 +230,8 @@
if (error.Fail() || !exe_module_sp)
{
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
+ exe_file.GetPath().c_str(),
GetShortPluginName(),
arch_names.GetString().c_str());
}
diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
index 48a25c4..fe6d358 100644
--- a/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
@@ -205,10 +205,9 @@
for (uint32_t i=0; i<num_sdk_infos; ++i)
{
const SDKDirectoryInfo &sdk_dir_info = m_sdk_directory_infos[i];
- strm.Printf (" SDK Roots: [%2u] \"%s/%s\"\n",
+ strm.Printf (" SDK Roots: [%2u] \"%s\"\n",
i,
- sdk_dir_info.directory.GetDirectory().GetCString(),
- sdk_dir_info.directory.GetFilename().GetCString());
+ sdk_dir_info.directory.GetPath().c_str());
}
}
@@ -278,20 +277,16 @@
if (error.Fail() || !exe_module_sp)
{
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
+ exe_file.GetPath().c_str(),
GetShortPluginName(),
arch_names.GetString().c_str());
}
}
else
{
- error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""));
+ error.SetErrorStringWithFormat ("'%s' does not exist",
+ exe_file.GetPath().c_str());
}
return error;
@@ -712,7 +707,7 @@
{
if (GetFileInSDK (platform_file_path, m_last_module_sdk_idx, local_file))
{
- //printf ("sdk[%u] last: '%s/%s'\n", m_last_module_sdk_idx, local_file.GetDirectory().GetCString(), local_file.GetFilename().GetCString());
+ //printf ("sdk[%u] last: '%s'\n", m_last_module_sdk_idx, local_file.GetPath().c_str());
module_sp.reset();
error = ResolveExecutable (local_file,
module_spec.GetArchitecture(),
@@ -738,7 +733,7 @@
}
if (GetFileInSDK (platform_file_path, sdk_idx, local_file))
{
- //printf ("sdk[%u]: '%s/%s'\n", sdk_idx, local_file.GetDirectory().GetCString(), local_file.GetFilename().GetCString());
+ //printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str());
error = ResolveExecutable (local_file,
module_spec.GetArchitecture(),
diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
index 9003225..5f1cfc8 100644
--- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
@@ -240,20 +240,16 @@
if (error.Fail() || !exe_module_sp)
{
- error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""),
+ error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
+ exe_file.GetPath().c_str(),
GetShortPluginName(),
arch_names.GetString().c_str());
}
}
else
{
- error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""));
+ error.SetErrorStringWithFormat ("'%s' does not exist",
+ exe_file.GetPath().c_str());
}
return error;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 4030092..4c76eed 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -61,18 +61,16 @@
if (debug_aranges_data.GetByteSize() > 0)
{
if (log)
- log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s/%s\" from .debug_aranges",
- m_dwarf2Data->GetObjectFile()->GetFileSpec().GetDirectory().GetCString(),
- m_dwarf2Data->GetObjectFile()->GetFileSpec().GetFilename().GetCString());
+ log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" from .debug_aranges",
+ m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str());
m_cu_aranges_ap->Extract (debug_aranges_data);
}
else
{
if (log)
- log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s/%s\" by parsing",
- m_dwarf2Data->GetObjectFile()->GetFileSpec().GetDirectory().GetCString(),
- m_dwarf2Data->GetObjectFile()->GetFileSpec().GetFilename().GetCString());
+ log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" by parsing",
+ m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str());
const size_t num_compile_units = GetNumCompileUnits();
const bool clear_dies_if_already_not_parsed = true;
for (size_t idx = 0; idx < num_compile_units; ++idx)
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 6bb8fd17..cbed4f2 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2799,9 +2799,8 @@
#if defined (ENABLE_DEBUG_PRINTF)
StreamFile s(stdout, false);
- s.Printf ("DWARF index for '%s/%s':",
- GetObjectFile()->GetFileSpec().GetDirectory().AsCString(),
- GetObjectFile()->GetFileSpec().GetFilename().AsCString());
+ s.Printf ("DWARF index for '%s':",
+ GetObjectFile()->GetFileSpec().GetPath().c_str());
s.Printf("\nFunction basenames:\n"); m_function_basename_index.Dump (&s);
s.Printf("\nFunction fullnames:\n"); m_function_fullname_index.Dump (&s);
s.Printf("\nFunction methods:\n"); m_function_method_index.Dump (&s);
@@ -6478,12 +6477,11 @@
{
clang::CXXMethodDecl *cxx_method_decl;
// REMOVE THE CRASH DESCRIPTION BELOW
- Host::SetCrashDescriptionWithFormat ("SymbolFileDWARF::ParseType() is adding a method %s to class %s in DIE 0x%8.8" PRIx64 " from %s/%s",
+ Host::SetCrashDescriptionWithFormat ("SymbolFileDWARF::ParseType() is adding a method %s to class %s in DIE 0x%8.8" PRIx64 " from %s",
type_name_cstr,
class_type->GetName().GetCString(),
MakeUserID(die->GetOffset()),
- m_obj_file->GetFileSpec().GetDirectory().GetCString(),
- m_obj_file->GetFileSpec().GetFilename().GetCString());
+ m_obj_file->GetFileSpec().GetPath().c_str());
const bool is_attr_used = false;
@@ -7568,10 +7566,9 @@
{
StreamFile s(stdout, false);
- s.Printf ("DWARF index for (%s) '%s/%s':",
+ s.Printf ("DWARF index for (%s) '%s':",
GetObjectFile()->GetModule()->GetArchitecture().GetArchitectureName(),
- GetObjectFile()->GetFileSpec().GetDirectory().AsCString(),
- GetObjectFile()->GetFileSpec().GetFilename().AsCString());
+ GetObjectFile()->GetFileSpec().GetPath().c_str());
s.Printf("\nFunction basenames:\n"); m_function_basename_index.Dump (&s);
s.Printf("\nFunction fullnames:\n"); m_function_fullname_index.Dump (&s);
s.Printf("\nFunction methods:\n"); m_function_method_index.Dump (&s);
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 096b5fc..941484e 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -59,13 +59,9 @@
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 @@
#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);
diff --git a/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 032fa0a..c04ad78 100644
--- a/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -159,9 +159,8 @@
return NULL;
Timer scoped_timer (__PRETTY_FUNCTION__,
- "SymbolVendorMacOSX::CreateInstance (module = %s/%s)",
- module_sp->GetFileSpec().GetDirectory().AsCString(),
- module_sp->GetFileSpec().GetFilename().AsCString());
+ "SymbolVendorMacOSX::CreateInstance (module = %s)",
+ module_sp->GetFileSpec().GetPath().c_str());
SymbolVendorMacOSX* symbol_vendor = new SymbolVendorMacOSX(module_sp);
if (symbol_vendor)
{
@@ -173,9 +172,8 @@
if (obj_file)
{
Timer scoped_timer2 ("SymbolVendorMacOSX::CreateInstance () locate dSYM",
- "SymbolVendorMacOSX::CreateInstance (module = %s/%s) locate dSYM",
- module_sp->GetFileSpec().GetDirectory().AsCString(),
- module_sp->GetFileSpec().GetFilename().AsCString());
+ "SymbolVendorMacOSX::CreateInstance (module = %s) locate dSYM",
+ module_sp->GetFileSpec().GetPath().c_str());
// First check to see if the module has a symbol file in mind already.
// If it does, then we MUST use that.
diff --git a/source/Symbol/Block.cpp b/source/Symbol/Block.cpp
index f410bd6..4ab86e5 100644
--- a/source/Symbol/Block.cpp
+++ b/source/Symbol/Block.cpp
@@ -408,9 +408,8 @@
const Declaration &func_decl = func_type->GetDeclaration();
if (func_decl.GetLine())
{
- log->Printf ("warning: %s/%s:%u block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s/%s",
- func_decl.GetFile().GetDirectory().GetCString(),
- func_decl.GetFile().GetFilename().GetCString(),
+ log->Printf ("warning: %s:%u block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s",
+ func_decl.GetFile().GetPath().c_str(),
func_decl.GetLine(),
GetID(),
(uint32_t)m_ranges.GetSize(),
@@ -418,20 +417,18 @@
block_end_addr,
parent_block->GetID(),
function->GetID(),
- module_sp->GetFileSpec().GetDirectory().GetCString(),
- module_sp->GetFileSpec().GetFilename().GetCString());
+ module_sp->GetFileSpec().GetPath().c_str());
}
else
{
- log->Printf ("warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s/%s",
+ log->Printf ("warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s",
GetID(),
(uint32_t)m_ranges.GetSize(),
block_start_addr,
block_end_addr,
parent_block->GetID(),
function->GetID(),
- module_sp->GetFileSpec().GetDirectory().GetCString(),
- module_sp->GetFileSpec().GetFilename().GetCString());
+ module_sp->GetFileSpec().GetPath().c_str());
}
}
parent_block->AddRange (range);
diff --git a/source/Symbol/Function.cpp b/source/Symbol/Function.cpp
index 64c22ef..c42b0cf 100644
--- a/source/Symbol/Function.cpp
+++ b/source/Symbol/Function.cpp
@@ -315,11 +315,9 @@
else
{
Host::SystemLog (Host::eSystemLogError,
- "error: unable to find module shared pointer for function '%s' in %s%s%s\n",
+ "error: unable to find module shared pointer for function '%s' in %s\n",
GetName().GetCString(),
- m_comp_unit->GetDirectory().GetCString(),
- m_comp_unit->GetDirectory() ? "/" : "",
- m_comp_unit->GetFilename().GetCString());
+ m_comp_unit->GetPath().c_str());
}
m_block.SetBlockInfoHasBeenParsed (true, true);
}
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp
index a713543..759477d 100644
--- a/source/Symbol/ObjectFile.cpp
+++ b/source/Symbol/ObjectFile.cpp
@@ -40,9 +40,8 @@
if (module_sp)
{
Timer scoped_timer (__PRETTY_FUNCTION__,
- "ObjectFile::FindPlugin (module = %s/%s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
- module_sp->GetFileSpec().GetDirectory().AsCString(),
- module_sp->GetFileSpec().GetFilename().AsCString(),
+ "ObjectFile::FindPlugin (module = %s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
+ module_sp->GetFileSpec().GetPath().c_str(),
file, (uint64_t) file_offset, (uint64_t) file_size);
if (file)
{
@@ -162,9 +161,8 @@
if (module_sp)
{
Timer scoped_timer (__PRETTY_FUNCTION__,
- "ObjectFile::FindPlugin (module = %s/%s, process = %p, header_addr = 0x%" PRIx64 ")",
- module_sp->GetFileSpec().GetDirectory().AsCString(),
- module_sp->GetFileSpec().GetFilename().AsCString(),
+ "ObjectFile::FindPlugin (module = %s, process = %p, header_addr = 0x%" PRIx64 ")",
+ module_sp->GetFileSpec().GetPath().c_str(),
process_sp.get(), header_addr);
uint32_t idx;
@@ -255,30 +253,22 @@
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
if (log)
{
- const ConstString object_name (module_sp->GetObjectName());
if (m_file)
{
- log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s%s%s%s), file = %s/%s, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
+ log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = %s, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
this,
module_sp.get(),
- module_sp->GetFileSpec().GetFilename().AsCString(),
- object_name ? "(" : "",
- object_name ? object_name.GetCString() : "",
- object_name ? ")" : "",
- m_file.GetDirectory().AsCString(),
- m_file.GetFilename().AsCString(),
+ module_sp->GetSpecificationDescription().c_str(),
+ m_file.GetPath().c_str(),
m_file_offset,
m_length);
}
else
{
- log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s%s%s%s), file = <NULL>, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
+ log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = <NULL>, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
this,
module_sp.get(),
- module_sp->GetFileSpec().GetFilename().AsCString(),
- object_name ? "(" : "",
- object_name ? object_name.GetCString() : "",
- object_name ? ")" : "",
+ module_sp->GetSpecificationDescription().c_str(),
m_file_offset,
m_length);
}
@@ -308,14 +298,10 @@
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
if (log)
{
- const ConstString object_name (module_sp->GetObjectName());
- log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s%s%s%s), process = %p, header_addr = 0x%" PRIx64,
+ log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), process = %p, header_addr = 0x%" PRIx64,
this,
module_sp.get(),
- module_sp->GetFileSpec().GetFilename().AsCString(),
- object_name ? "(" : "",
- object_name ? object_name.GetCString() : "",
- object_name ? ")" : "",
+ module_sp->GetSpecificationDescription().c_str(),
process_sp.get(),
m_memory_addr);
}
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp
index 49cb1c4..7c83778 100644
--- a/source/Symbol/SymbolContext.cpp
+++ b/source/Symbol/SymbolContext.cpp
@@ -517,11 +517,10 @@
if (objfile)
{
Host::SystemLog (Host::eSystemLogWarning,
- "warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64 " in %s/%s\n",
+ "warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64 " in %s\n",
curr_inlined_block->GetID(),
curr_frame_pc.GetFileAddress(),
- objfile->GetFileSpec().GetDirectory().GetCString(),
- objfile->GetFileSpec().GetFilename().GetCString());
+ objfile->GetFileSpec().GetPath().c_str());
}
else
{
diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp
index 3f407b9..c0f241e 100644
--- a/source/Symbol/Symtab.cpp
+++ b/source/Symbol/Symtab.cpp
@@ -90,9 +90,8 @@
object_name = m_objfile->GetModule()->GetObjectName().GetCString();
if (file_spec)
- s->Printf("Symtab, file = %s/%s%s%s%s, num_symbols = %lu",
- file_spec.GetDirectory().AsCString(),
- file_spec.GetFilename().AsCString(),
+ s->Printf("Symtab, file = %s%s%s%s, num_symbols = %lu",
+ file_spec.GetPath().c_str(),
object_name ? "(" : "",
object_name ? object_name : "",
object_name ? ")" : "",
diff --git a/source/Symbol/UnwindTable.cpp b/source/Symbol/UnwindTable.cpp
index f128066..c77628b 100644
--- a/source/Symbol/UnwindTable.cpp
+++ b/source/Symbol/UnwindTable.cpp
@@ -135,7 +135,7 @@
void
UnwindTable::Dump (Stream &s)
{
- s.Printf("UnwindTable for %s/%s:\n", m_object_file.GetFileSpec().GetDirectory().GetCString(), m_object_file.GetFileSpec().GetFilename().GetCString());
+ s.Printf("UnwindTable for '%s':\n", m_object_file.GetFileSpec().GetPath().c_str());
const_iterator begin = m_unwinds.begin();
const_iterator end = m_unwinds.end();
for (const_iterator pos = begin; pos != end; ++pos)
diff --git a/source/Target/Platform.cpp b/source/Target/Platform.cpp
index ed98fb2..c1834d2 100644
--- a/source/Target/Platform.cpp
+++ b/source/Target/Platform.cpp
@@ -510,10 +510,8 @@
}
else
{
- error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
- exe_file.GetDirectory().AsCString(""),
- exe_file.GetDirectory() ? "/" : "",
- exe_file.GetFilename().AsCString(""));
+ error.SetErrorStringWithFormat ("'%s' does not exist",
+ exe_file.GetPath().c_str());
}
return error;
}
diff --git a/source/Target/SectionLoadList.cpp b/source/Target/SectionLoadList.cpp
index 9b4bdd0..af56365 100644
--- a/source/Target/SectionLoadList.cpp
+++ b/source/Target/SectionLoadList.cpp
@@ -64,12 +64,10 @@
if (log)
{
const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
- log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16" PRIx64 ")",
+ log->Printf ("SectionLoadList::%s (section = %p (%s.%s), load_addr = 0x%16.16" PRIx64 ")",
__FUNCTION__,
section.get(),
- module_file_spec.GetDirectory().AsCString(),
- module_file_spec.GetDirectory() ? "/" : "",
- module_file_spec.GetFilename().AsCString(),
+ module_file_spec.GetPath().c_str(),
section->GetName().AsCString(),
load_addr);
}
@@ -141,12 +139,10 @@
if (log)
{
const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
- log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s))",
+ log->Printf ("SectionLoadList::%s (section = %p (%s.%s))",
__FUNCTION__,
section_sp.get(),
- module_file_spec.GetDirectory().AsCString(),
- module_file_spec.GetDirectory() ? "/" : "",
- module_file_spec.GetFilename().AsCString(),
+ module_file_spec.GetPath().c_str(),
section_sp->GetName().AsCString());
}
@@ -175,12 +171,10 @@
if (log)
{
const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
- log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16" PRIx64 ")",
+ log->Printf ("SectionLoadList::%s (section = %p (%s.%s), load_addr = 0x%16.16" PRIx64 ")",
__FUNCTION__,
section_sp.get(),
- module_file_spec.GetDirectory().AsCString(),
- module_file_spec.GetDirectory() ? "/" : "",
- module_file_spec.GetFilename().AsCString(),
+ module_file_spec.GetPath().c_str(),
section_sp->GetName().AsCString(),
load_addr);
}
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index f07cfdd..c54cc15 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -1004,9 +1004,8 @@
if (executable_sp.get())
{
Timer scoped_timer (__PRETTY_FUNCTION__,
- "Target::SetExecutableModule (executable = '%s/%s')",
- executable_sp->GetFileSpec().GetDirectory().AsCString(),
- executable_sp->GetFileSpec().GetFilename().AsCString());
+ "Target::SetExecutableModule (executable = '%s')",
+ executable_sp->GetFileSpec().GetPath().c_str());
m_images.Append(executable_sp); // The first image is our exectuable file
diff --git a/source/Target/TargetList.cpp b/source/Target/TargetList.cpp
index 1bc3294..a4411b0 100644
--- a/source/Target/TargetList.cpp
+++ b/source/Target/TargetList.cpp
@@ -105,12 +105,10 @@
{
if (!platform_arch.IsCompatibleMatch(matching_module_spec.GetArchitecture()))
{
- error.SetErrorStringWithFormat("the specified architecture '%s' is not compatible with '%s' in '%s%s%s'",
+ error.SetErrorStringWithFormat("the specified architecture '%s' is not compatible with '%s' in '%s'",
platform_arch.GetTriple().str().c_str(),
matching_module_spec.GetArchitecture().GetTriple().str().c_str(),
- module_spec.GetFileSpec().GetDirectory() ? module_spec.GetFileSpec().GetDirectory().GetCString() : "",
- module_spec.GetFileSpec().GetDirectory() ? "/" : "",
- module_spec.GetFileSpec().GetFilename().GetCString());
+ module_spec.GetFileSpec().GetPath().c_str());
return error;
}
}
@@ -266,18 +264,14 @@
{
if (arch.IsValid())
{
- error.SetErrorStringWithFormat("\"%s%s%s\" doesn't contain architecture %s",
- file.GetDirectory().AsCString(),
- file.GetDirectory() ? "/" : "",
- file.GetFilename().AsCString(),
+ error.SetErrorStringWithFormat("\"%s\" doesn't contain architecture %s",
+ file.GetPath().c_str(),
arch.GetArchitectureName());
}
else
{
- error.SetErrorStringWithFormat("unsupported file type \"%s%s%s\"",
- file.GetDirectory().AsCString(),
- file.GetDirectory() ? "/" : "",
- file.GetFilename().AsCString());
+ error.SetErrorStringWithFormat("unsupported file type \"%s\"",
+ file.GetPath().c_str());
}
return error;
}