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

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

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

llvm-svn: 180717
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 4030092..4c76eed 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/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/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 6bb8fd17..cbed4f2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/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/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 096b5fc..941484e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/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);