[Lldb-commits] [lldb] r243330 - If a path contains a '/' before a ':', then the ':' is not a hostname separator, but just a part of the path (e.g. /tmp/fi:lename vs. pro:/tmp/fi:lename)

Enrico Granata egranata at apple.com
Mon Jul 27 14:27:02 PDT 2015


Author: enrico
Date: Mon Jul 27 16:27:02 2015
New Revision: 243330

URL: http://llvm.org/viewvc/llvm-project?rev=243330&view=rev
Log:
If a path contains a '/' before a ':', then the ':' is not a hostname separator, but just a part of the path (e.g. /tmp/fi:lename vs. pro:/tmp/fi:lename)


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

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=243330&r1=243329&r2=243330&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jul 27 16:27:02 2015
@@ -126,9 +126,15 @@ removeHostnameFromPathname(const char* p
     {
         return path_from_dwarf;
     }
-
+    
     const char *colon_pos = strchr(path_from_dwarf, ':');
-    if (!colon_pos)
+    if (nullptr == colon_pos)
+    {
+        return path_from_dwarf;
+    }
+    
+    const char *slash_pos = strchr(path_from_dwarf, '/');
+    if (slash_pos && (slash_pos < colon_pos))
     {
         return path_from_dwarf;
     }
@@ -143,7 +149,7 @@ removeHostnameFromPathname(const char* p
     {
         return path_from_dwarf;
     }
-
+    
     return colon_pos + 1;
 }
 





More information about the lldb-commits mailing list