[Lldb-commits] [lldb] r239358 - Fix TestSymbolContext for remote Windows to Android.

Chaoren Lin chaorenl at google.com
Mon Jun 8 15:12:59 PDT 2015


Author: chaoren
Date: Mon Jun  8 17:12:58 2015
New Revision: 239358

URL: http://llvm.org/viewvc/llvm-project?rev=239358&view=rev
Log:
Fix TestSymbolContext for remote Windows to Android.

Summary: Denormalize path returned by SBFileSpec::GetDirectory().

Reviewers: zturner, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D10298

Modified:
    lldb/trunk/source/API/SBFileSpec.cpp

Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=239358&r1=239357&r2=239358&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Mon Jun  8 17:12:58 2015
@@ -119,18 +119,19 @@ SBFileSpec::GetFilename() const
 const char *
 SBFileSpec::GetDirectory() const
 {
-    const char *s = m_opaque_ap->GetDirectory().AsCString();
+    FileSpec directory{*m_opaque_ap};
+    directory.GetFilename().Clear();
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
-        if (s)
+        if (directory)
             log->Printf ("SBFileSpec(%p)::GetDirectory () => \"%s\"",
-                         static_cast<void*>(m_opaque_ap.get()), s);
+                         static_cast<void*>(m_opaque_ap.get()), directory.GetCString());
         else
             log->Printf ("SBFileSpec(%p)::GetDirectory () => NULL",
                          static_cast<void*>(m_opaque_ap.get()));
     }
-    return s;
+    return directory.GetCString();
 }
 
 void





More information about the lldb-commits mailing list