[Lldb-commits] [lldb] r180717 - Cleanup logging to use the new "std::string FileSpec::GetPath()" function. Also added a similar function for modules:
Greg Clayton
gclayton at apple.com
Mon Apr 29 10:25:54 PDT 2013
Author: gclayton
Date: Mon Apr 29 12:25:54 2013
New Revision: 180717
URL: http://llvm.org/viewvc/llvm-project?rev=180717&view=rev
Log:
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.
Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/source/API/SBModule.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Core/DataBufferMemoryMap.cpp
lldb/trunk/source/Core/FileLineResolver.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Core/Value.cpp
lldb/trunk/source/Host/macosx/Host.mm
lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
lldb/trunk/source/Symbol/Block.cpp
lldb/trunk/source/Symbol/Function.cpp
lldb/trunk/source/Symbol/ObjectFile.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/Symtab.cpp
lldb/trunk/source/Symbol/UnwindTable.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/SectionLoadList.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/TargetList.cpp
Modified: lldb/trunk/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Mon Apr 29 12:25:54 2013
@@ -151,6 +151,29 @@ public:
lldb::DescriptionLevel level = lldb::eDescriptionLevelFull);
//------------------------------------------------------------------
+ /// Get the module path and object name.
+ ///
+ /// Modules can refer to object files. In this case the specification
+ /// is simple and would return the path to the file:
+ ///
+ /// "/usr/lib/foo.dylib"
+ ///
+ /// Modules can be .o files inside of a BSD archive (.a file). In
+ /// this case, the object specification will look like:
+ ///
+ /// "/usr/lib/foo.a(bar.o)"
+ ///
+ /// There are many places where logging wants to log this fully
+ /// qualified specification, so we centralize this functionality
+ /// here.
+ ///
+ /// @return
+ /// The object path + object name if there is one.
+ //------------------------------------------------------------------
+ std::string
+ GetSpecificationDescription () const;
+
+ //------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
/// Dump a description of the contents of this object to the
Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Mon Apr 29 12:25:54 2013
@@ -139,12 +139,10 @@ SBModule::SetPlatformFileSpec (const lld
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;
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Apr 29 12:25:54 2013
@@ -721,24 +721,20 @@ protected:
{
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 @@ protected:
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 @@ protected:
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 @@ DumpModuleSections (CommandInterpreter &
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 @@ protected:
{
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 @@ protected:
{
// 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
Modified: lldb/trunk/source/Core/DataBufferMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferMemoryMap.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataBufferMemoryMap.cpp (original)
+++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp Mon Apr 29 12:25:54 2013
@@ -113,9 +113,8 @@ DataBufferMemoryMap::MemoryMapFromFileSp
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);
Modified: lldb/trunk/source/Core/FileLineResolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileLineResolver.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Core/FileLineResolver.cpp (original)
+++ lldb/trunk/source/Core/FileLineResolver.cpp Mon Apr 29 12:25:54 2013
@@ -90,10 +90,8 @@ FileLineResolver::GetDepth()
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);
}
Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Mon Apr 29 12:25:54 2013
@@ -156,11 +156,10 @@ Module::Module (const ModuleSpec &module
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 @@ Module::Module(const FileSpec& file_spec
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 @@ Module::~Module()
}
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 @@ Module::ResolveSymbolContextsForFileSpec
{
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 @@ Module::GetArchitecture () const
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 @@ Module::Dump(Stream *s)
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 ? ")" : "");
Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Mon Apr 29 12:25:54 2013
@@ -658,13 +658,12 @@ ModuleList::LogUUIDAndPaths (Log *log, c
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());
}
}
}
Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Mon Apr 29 12:25:54 2013
@@ -494,18 +494,14 @@ Value::GetValueAsData (ExecutionContext
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
{
Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Apr 29 12:25:54 2013
@@ -502,9 +502,8 @@ LaunchInNewTerminalWithAppleScript (cons
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;
}
Modified: lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp Mon Apr 29 12:25:54 2013
@@ -64,17 +64,7 @@ OptionValueFileSpec::DumpValue (const Ex
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() << '"';
}
}
}
Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Mon Apr 29 12:25:54 2013
@@ -955,15 +955,9 @@ DynamicLoaderDarwinKernel::KextImageInfo
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 ();
}
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Mon Apr 29 12:25:54 2013
@@ -493,11 +493,10 @@ DynamicLoaderMacOSXDYLD::UpdateImageLoad
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::UnloadImageLoad
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::
{
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)
Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp Mon Apr 29 12:25:54 2013
@@ -286,9 +286,8 @@ ObjectContainerBSDArchive::CreateInstanc
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
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Apr 29 12:25:54 2013
@@ -1916,11 +1916,10 @@ ObjectFileMachO::ParseSymtab (bool minim
// 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 @@ ObjectFileMachO::ParseSymtab (bool minim
// 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')
Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Mon Apr 29 12:25:54 2013
@@ -232,10 +232,8 @@ PlatformFreeBSD::ResolveExecutable (cons
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 @@ PlatformFreeBSD::ResolveExecutable (cons
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 @@ PlatformFreeBSD::ResolveExecutable (cons
}
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;
Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Mon Apr 29 12:25:54 2013
@@ -206,10 +206,8 @@ PlatformLinux::ResolveExecutable (const
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 @@ PlatformLinux::ResolveExecutable (const
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());
}
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Mon Apr 29 12:25:54 2013
@@ -196,10 +196,8 @@ PlatformDarwin::ResolveExecutable (const
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 @@ PlatformDarwin::ResolveExecutable (const
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());
}
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Mon Apr 29 12:25:54 2013
@@ -205,10 +205,9 @@ PlatformRemoteiOS::GetStatus (Stream &st
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 @@ PlatformRemoteiOS::ResolveExecutable (co
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 @@ PlatformRemoteiOS::GetSharedModule (cons
{
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 @@ PlatformRemoteiOS::GetSharedModule (cons
}
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(),
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp Mon Apr 29 12:25:54 2013
@@ -240,20 +240,16 @@ PlatformiOSSimulator::ResolveExecutable
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;
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Mon Apr 29 12:25:54 2013
@@ -61,18 +61,16 @@ DWARFDebugInfo::GetCompileUnitAranges ()
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)
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Apr 29 12:25:54 2013
@@ -2799,9 +2799,8 @@ SymbolFileDWARF::Index ()
#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 @@ SymbolFileDWARF::ParseType (const Symbol
{
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 @@ SymbolFileDWARF::DumpIndexes ()
{
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);
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Mon Apr 29 12:25:54 2013
@@ -59,13 +59,9 @@ SymbolFileDWARFDebugMap::CompileUnitInfo
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::FinalizeOSOFile
#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);
Modified: lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Mon Apr 29 12:25:54 2013
@@ -159,9 +159,8 @@ SymbolVendorMacOSX::CreateInstance (cons
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 @@ SymbolVendorMacOSX::CreateInstance (cons
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.
Modified: lldb/trunk/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Block.cpp (original)
+++ lldb/trunk/source/Symbol/Block.cpp Mon Apr 29 12:25:54 2013
@@ -408,9 +408,8 @@ Block::AddRange (const Range& range)
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::AddRange (const Range& range)
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);
Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Mon Apr 29 12:25:54 2013
@@ -315,11 +315,9 @@ Function::GetBlock (bool can_create)
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);
}
Modified: lldb/trunk/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Mon Apr 29 12:25:54 2013
@@ -40,9 +40,8 @@ ObjectFile::FindPlugin (const lldb::Modu
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 @@ ObjectFile::FindPlugin (const lldb::Modu
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 @@ ObjectFile::ObjectFile (const lldb::Modu
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 @@ ObjectFile::ObjectFile (const lldb::Modu
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);
}
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Mon Apr 29 12:25:54 2013
@@ -517,11 +517,10 @@ SymbolContext::GetParentOfInlinedScope (
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
{
Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Mon Apr 29 12:25:54 2013
@@ -90,9 +90,8 @@ Symtab::Dump (Stream *s, Target *target,
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 ? ")" : "",
Modified: lldb/trunk/source/Symbol/UnwindTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/UnwindTable.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/UnwindTable.cpp (original)
+++ lldb/trunk/source/Symbol/UnwindTable.cpp Mon Apr 29 12:25:54 2013
@@ -135,7 +135,7 @@ UnwindTable::GetUncachedFuncUnwindersCon
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)
Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Mon Apr 29 12:25:54 2013
@@ -510,10 +510,8 @@ Platform::ResolveExecutable (const FileS
}
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;
}
Modified: lldb/trunk/source/Target/SectionLoadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/SectionLoadList.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Target/SectionLoadList.cpp (original)
+++ lldb/trunk/source/Target/SectionLoadList.cpp Mon Apr 29 12:25:54 2013
@@ -64,12 +64,10 @@ SectionLoadList::SetSectionLoadAddress (
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 @@ SectionLoadList::SetSectionUnloaded (con
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 @@ SectionLoadList::SetSectionUnloaded (con
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);
}
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Mon Apr 29 12:25:54 2013
@@ -1004,9 +1004,8 @@ Target::SetExecutableModule (ModuleSP& e
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
Modified: lldb/trunk/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/TargetList.cpp?rev=180717&r1=180716&r2=180717&view=diff
==============================================================================
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Mon Apr 29 12:25:54 2013
@@ -105,12 +105,10 @@ TargetList::CreateTarget (Debugger &debu
{
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 @@ TargetList::CreateTarget (Debugger &debu
{
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;
}
More information about the lldb-commits
mailing list