<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Will do<div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 27, 2018, at 1:01 PM, Frédéric Riss <<a href="mailto:friss@apple.com" class="">friss@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">On Apr 27, 2018, at 11:17 AM, Jim Ingham via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Greg,<br class=""><br class="">Your new FileSpecTest unit tests are failing in the Xcode build of lldb, e.g.:<br class=""><br class=""><a href="http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671" class="">http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671</a><br class=""><br class="">Can you figure out what's up with this?<br class=""></blockquote><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Once you get past the unit test, it looks like it also broke TestBreakpointCommand.py. Please fix this quickly.</span><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Fred</span><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Jim<br class=""><br class="">BTW, the "reply to" for lldb-commits mails for you is still your <a href="http://apple.com" class="">apple.com</a> address.  I don't know where that gets set but you should probably update that at some point.<br class=""><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Apr 27, 2018, at 8:45 AM, Greg Clayton via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: gclayton<br class="">Date: Fri Apr 27 08:45:58 2018<br class="">New Revision: 331049<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=331049&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=331049&view=rev</a><br class="">Log:<br class="">Always normalize FileSpec paths.<br class=""><br class="">Always normalizing lldb_private::FileSpec paths will help us get a consistent results from comparisons when setting breakpoints and when looking for source files. This also removes a lot of complexity from the comparison routines. Modified the DWARF line table parser to use the normalized compile unit directory if needed.<br class=""><br class="">Differential Revision: <a href="https://reviews.llvm.org/D45977" class="">https://reviews.llvm.org/D45977</a><br class=""><br class=""><br class="">Modified:<br class="">lldb/trunk/include/lldb/Core/FileSpecList.h<br class="">lldb/trunk/include/lldb/Utility/FileSpec.h<br class="">lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp<br class="">lldb/trunk/source/Core/FileSpecList.cpp<br class="">lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp<br class="">lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp<br class="">lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h<br class="">lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br class="">lldb/trunk/source/Symbol/CompileUnit.cpp<br class="">lldb/trunk/source/Symbol/Declaration.cpp<br class="">lldb/trunk/source/Utility/FileSpec.cpp<br class="">lldb/trunk/unittests/Utility/FileSpecTest.cpp<br class=""><br class="">Modified: lldb/trunk/include/lldb/Core/FileSpecList.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/include/lldb/Core/FileSpecList.h (original)<br class="">+++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018<br class="">@@ -119,16 +119,11 @@ public:<br class="">/// @param[in] full<br class="">///     Should FileSpec::Equal be called with "full" true or false.<br class="">///<br class="">-  /// @param[in] remove_backup_dots<br class="">-  ///     Should FileSpec::Equal be called with "remove_backup_dots" true or<br class="">-  ///     false.<br class="">-  ///<br class="">/// @return<br class="">///     The index of the file that matches \a file if it is found,<br class="">///     else UINT32_MAX is returned.<br class="">//------------------------------------------------------------------<br class="">-  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,<br class="">-                       bool remove_backup_dots = false) const;<br class="">+  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;<br class=""><br class="">//------------------------------------------------------------------<br class="">/// Get file at index.<br class=""><br class="">Modified: lldb/trunk/include/lldb/Utility/FileSpec.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/include/lldb/Utility/FileSpec.h (original)<br class="">+++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018<br class="">@@ -256,8 +256,7 @@ public:<br class="">//------------------------------------------------------------------<br class="">static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);<br class=""><br class="">-  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,<br class="">-                    bool remove_backups = false);<br class="">+  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);<br class=""><br class="">//------------------------------------------------------------------<br class="">/// Case sensitivity of path.<br class="">@@ -488,12 +487,6 @@ public:<br class="">size_t MemorySize() const;<br class=""><br class="">//------------------------------------------------------------------<br class="">-  /// Normalize a pathname by collapsing redundant separators and<br class="">-  /// up-level references.<br class="">-  //------------------------------------------------------------------<br class="">-  FileSpec GetNormalizedPath() const;<br class="">-<br class="">-  //------------------------------------------------------------------<br class="">/// Change the file specified with a new path.<br class="">///<br class="">/// Update the contents of this object with a new path. The path will<br class=""><br class="">Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp (original)<br class="">+++ lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -122,7 +122,7 @@ void BreakpointResolverFileLine::FilterC<br class=""><br class="">llvm::StringRef relative_path;<br class="">if (is_relative)<br class="">-    relative_path = m_file_spec.GetNormalizedPath().GetDirectory().GetStringRef();<br class="">+    relative_path = m_file_spec.GetDirectory().GetStringRef();<br class=""><br class="">Log * log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);<br class="">for(uint32_t i = 0; i < sc_list.GetSize(); ++i) {<br class=""><br class="">Modified: lldb/trunk/source/Core/FileSpecList.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpecList.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpecList.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Core/FileSpecList.cpp (original)<br class="">+++ lldb/trunk/source/Core/FileSpecList.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -82,7 +82,7 @@ void FileSpecList::Dump(Stream *s, const<br class="">// it is found, else std::numeric_limits<uint32_t>::max() is returned.<br class="">//------------------------------------------------------------------<br class="">size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec,<br class="">-                                   bool full, bool remove_dots) const {<br class="">+                                   bool full) const {<br class="">const size_t num_files = m_files.size();<br class=""><br class="">// When looking for files, we will compare only the filename if the<br class="">@@ -96,7 +96,7 @@ size_t FileSpecList::FindFileIndex(size_<br class="">          file_spec.IsCaseSensitive() || m_files[idx].IsCaseSensitive()))<br class="">    return idx;<br class="">} else {<br class="">-      if (FileSpec::Equal(m_files[idx], file_spec, full, remove_dots))<br class="">+      if (FileSpec::Equal(m_files[idx], file_spec, full))<br class="">    return idx;<br class="">}<br class="">}<br class=""><br class="">Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)<br class="">+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -5098,9 +5098,6 @@ uint32_t ObjectFileMachO::GetDependentMo<br class="">      // It is OK to resolve this path because we must find a file on<br class="">      // disk for us to accept it anyway if it is rpath relative.<br class="">      FileSpec file_spec(path, true);<br class="">-          // Remove any redundant parts of the path (like "../foo") since<br class="">-          // LC_RPATH values often contain "..".<br class="">-          file_spec = file_spec.GetNormalizedPath();<br class="">      if (file_spec.Exists() && files.AppendIfUnique(file_spec)) {<br class="">        count++;<br class="">        break;<br class="">@@ -5118,7 +5115,6 @@ uint32_t ObjectFileMachO::GetDependentMo<br class="">  for (const auto &at_exec_relative_path : at_exec_relative_paths) {<br class="">    FileSpec file_spec =<span class="Apple-converted-space"> </span><br class="">        exec_dir.CopyByAppendingPathComponent(at_exec_relative_path);<br class="">-        file_spec = file_spec.GetNormalizedPath();<br class="">    if (file_spec.Exists() && files.AppendIfUnique(file_spec))<br class="">      count++;<br class="">  }<br class=""><br class="">Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original)<br class="">+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -444,7 +444,7 @@ bool DWARFDebugLine::ParsePrologue(const<br class=""><br class="">bool DWARFDebugLine::ParseSupportFiles(<br class="">const lldb::ModuleSP &module_sp, const DWARFDataExtractor &debug_line_data,<br class="">-    const char *cu_comp_dir, dw_offset_t stmt_list,<br class="">+    const lldb_private::FileSpec &cu_comp_dir, dw_offset_t stmt_list,<br class="">FileSpecList &support_files) {<br class="">lldb::offset_t offset = stmt_list;<br class=""><br class="">@@ -861,8 +861,8 @@ void DWARFDebugLine::Prologue::Dump(Log<br class="">//  buff.Append8(0);    // Terminate the file names section with empty string<br class="">//}<br class=""><br class="">-bool DWARFDebugLine::Prologue::GetFile(uint32_t file_idx, const char *comp_dir,<br class="">-                                       FileSpec &file) const {<br class="">+bool DWARFDebugLine::Prologue::GetFile(uint32_t file_idx,<br class="">+    const lldb_private::FileSpec &comp_dir, FileSpec &file) const {<br class="">uint32_t idx = file_idx - 1; // File indexes are 1 based...<br class="">if (idx < file_names.size()) {<br class="">file.SetFile(file_names[idx].name, false);<br class="">@@ -876,7 +876,7 @@ bool DWARFDebugLine::Prologue::GetFile(u<br class="">    }<br class="">  }<br class=""><br class="">-      if (comp_dir && comp_dir[0])<br class="">+      if (comp_dir)<br class="">    file.PrependPathComponent(comp_dir);<br class="">}<br class="">return true;<br class=""><br class="">Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h (original)<br class="">+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h Fri Apr 27 08:45:58 2018<br class="">@@ -90,7 +90,7 @@ public:<br class="">  include_directories.clear();<br class="">  file_names.clear();<br class="">}<br class="">-    bool GetFile(uint32_t file_idx, const char *comp_dir,<br class="">+    bool GetFile(uint32_t file_idx, const lldb_private::FileSpec &cu_comp_dir,<br class="">             lldb_private::FileSpec &file) const;<br class="">};<br class=""><br class="">@@ -199,7 +199,8 @@ public:<br class="">static bool<br class="">ParseSupportFiles(const lldb::ModuleSP &module_sp,<br class="">                const lldb_private::DWARFDataExtractor &debug_line_data,<br class="">-                    const char *cu_comp_dir, dw_offset_t stmt_list,<br class="">+                    const lldb_private::FileSpec &cu_comp_dir,<br class="">+                    dw_offset_t stmt_list,<br class="">                lldb_private::FileSpecList &support_files);<br class="">static bool<br class="">ParsePrologue(const lldb_private::DWARFDataExtractor &debug_line_data,<br class=""><br class="">Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)<br class="">+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -174,38 +174,39 @@ static const char *removeHostnameFromPat<br class="">return colon_pos + 1;<br class="">}<br class=""><br class="">-static const char *resolveCompDir(const char *path_from_dwarf) {<br class="">+static FileSpec resolveCompDir(const char *path_from_dwarf) {<br class="">if (!path_from_dwarf)<br class="">-    return nullptr;<br class="">+    return FileSpec();<br class=""><br class="">// DWARF2/3 suggests the form hostname:pathname for compilation directory.<br class="">// Remove the host part if present.<br class="">const char *local_path = removeHostnameFromPathname(path_from_dwarf);<br class="">if (!local_path)<br class="">-    return nullptr;<br class="">+    return FileSpec();<br class=""><br class="">bool is_symlink = false;<br class="">-  FileSpec local_path_spec(local_path, false);<br class="">+  // Always normalize our compile unit directory to get rid of redundant<br class="">+  // slashes and other path anomalies before we use it for path prepending<br class="">+  FileSpec local_spec(local_path, false);<br class="">const auto &file_specs = GetGlobalPluginProperties()->GetSymLinkPaths();<br class="">for (size_t i = 0; i < file_specs.GetSize() && !is_symlink; ++i)<br class="">is_symlink = FileSpec::Equal(file_specs.GetFileSpecAtIndex(i),<br class="">-                                 local_path_spec, true);<br class="">+                                 local_spec, true);<br class=""><br class="">if (!is_symlink)<br class="">-    return local_path;<br class="">+    return local_spec;<br class=""><br class="">namespace fs = llvm::sys::fs;<br class="">-  if (fs::get_file_type(local_path_spec.GetPath(), false) !=<br class="">+  if (fs::get_file_type(local_spec.GetPath(), false) !=<br class="">  fs::file_type::symlink_file)<br class="">-    return local_path;<br class="">+    return local_spec;<br class=""><br class="">-  FileSpec resolved_local_path_spec;<br class="">-  const auto error =<br class="">-      FileSystem::Readlink(local_path_spec, resolved_local_path_spec);<br class="">+  FileSpec resolved_symlink;<br class="">+  const auto error = FileSystem::Readlink(local_spec, resolved_symlink);<br class="">if (error.Success())<br class="">-    return resolved_local_path_spec.GetCString();<br class="">+    return resolved_symlink;<br class=""><br class="">-  return nullptr;<br class="">+  return local_spec;<br class="">}<br class=""><br class="">DWARFUnit *SymbolFileDWARF::GetBaseCompileUnit() {<br class="">@@ -912,7 +913,7 @@ bool SymbolFileDWARF::ParseCompileUnitSu<br class="">const DWARFDIE cu_die = dwarf_cu->GetUnitDIEOnly();<br class=""><br class="">if (cu_die) {<br class="">-      const char *cu_comp_dir = resolveCompDir(<br class="">+      FileSpec cu_comp_dir = resolveCompDir(<br class="">      cu_die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr));<br class="">  const dw_offset_t stmt_list = cu_die.GetAttributeValueAsUnsigned(<br class="">      DW_AT_stmt_list, DW_INVALID_OFFSET);<br class=""><br class="">Modified: lldb/trunk/source/Symbol/CompileUnit.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompileUnit.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompileUnit.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Symbol/CompileUnit.cpp (original)<br class="">+++ lldb/trunk/source/Symbol/CompileUnit.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -287,9 +287,8 @@ uint32_t CompileUnit::ResolveSymbolConte<br class="">// when finding file indexes<br class="">std::vector<uint32_t> file_indexes;<br class="">const bool full_match = (bool)file_spec.GetDirectory();<br class="">-  const bool remove_backup_dots = true;<br class="">bool file_spec_matches_cu_file_spec =<br class="">-      FileSpec::Equal(file_spec, *this, full_match, remove_backup_dots);<br class="">+      FileSpec::Equal(file_spec, *this, full_match);<br class=""><br class="">// If we are not looking for inlined functions and our file spec doesn't<br class="">// match then we are done...<br class="">@@ -297,11 +296,10 @@ uint32_t CompileUnit::ResolveSymbolConte<br class="">return 0;<br class=""><br class="">uint32_t file_idx =<br class="">-      GetSupportFiles().FindFileIndex(1, file_spec, true, remove_backup_dots);<br class="">+      GetSupportFiles().FindFileIndex(1, file_spec, true);<br class="">while (file_idx != UINT32_MAX) {<br class="">file_indexes.push_back(file_idx);<br class="">-    file_idx = GetSupportFiles().FindFileIndex(file_idx + 1, file_spec, true,<br class="">-                                               remove_backup_dots);<br class="">+    file_idx = GetSupportFiles().FindFileIndex(file_idx + 1, file_spec, true);<br class="">}<br class=""><br class="">const size_t num_file_indexes = file_indexes.size();<br class=""><br class="">Modified: lldb/trunk/source/Symbol/Declaration.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Declaration.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Declaration.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Symbol/Declaration.cpp (original)<br class="">+++ lldb/trunk/source/Symbol/Declaration.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -91,7 +91,7 @@ bool lldb_private::operator==(const Decl<br class="">  return lhs.GetFile() == rhs.GetFile();<br class="">#else<br class="">if (lhs.GetLine() == rhs.GetLine())<br class="">-    return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true, true);<br class="">+    return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true);<br class="">#endif<br class="">return false;<br class="">}<br class=""><br class="">Modified: lldb/trunk/source/Utility/FileSpec.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/FileSpec.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/FileSpec.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Utility/FileSpec.cpp (original)<br class="">+++ lldb/trunk/source/Utility/FileSpec.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -62,17 +62,18 @@ bool IsPathSeparator(char value, FileSpe<br class="">return value == '/' || (!PathSyntaxIsPosix(syntax) && value == '\\');<br class="">}<br class=""><br class="">-void Normalize(llvm::SmallVectorImpl<char> &path, FileSpec::PathSyntax syntax) {<br class="">-  if (PathSyntaxIsPosix(syntax))<br class="">-    return;<br class="">-<br class="">-  std::replace(path.begin(), path.end(), '\\', '/');<br class="">-  // Windows path can have \\ slashes which can be changed by replace<br class="">-  // call above to //. Here we remove the duplicate.<br class="">-  auto iter = std::unique(path.begin(), path.end(), [](char &c1, char &c2) {<br class="">-    return (c1 == '/' && c2 == '/');<br class="">-  });<br class="">-  path.erase(iter, path.end());<br class="">+inline llvm::sys::path::Style<br class="">+LLVMPathSyntax(FileSpec::PathSyntax lldb_syntax) {<br class="">+  switch (lldb_syntax) {<br class="">+    case FileSpec::ePathSyntaxPosix:<br class="">+      return llvm::sys::path::Style::posix;<br class="">+    case FileSpec::ePathSyntaxWindows:<br class="">+      return llvm::sys::path::Style::windows;<br class="">+    default:<br class="">+    case FileSpec::ePathSyntaxHostNative:<br class="">+      return llvm::sys::path::Style::native;<br class="">+  };<br class="">+  return llvm::sys::path::Style::native;<br class="">}<br class=""><br class="">void Denormalize(llvm::SmallVectorImpl<char> &path,<br class="">@@ -199,6 +200,104 @@ FileSpec::FileSpec(const FileSpec *rhs)<br class="">//------------------------------------------------------------------<br class="">FileSpec::~FileSpec() {}<br class=""><br class="">+namespace {<br class="">+//------------------------------------------------------------------<br class="">+/// Safely get a character at the specified index.<br class="">+///<br class="">+/// @param[in] path<br class="">+///     A full, partial, or relative path to a file.<br class="">+///<br class="">+/// @param[in] i<br class="">+///     An index into path which may or may not be valid.<br class="">+///<br class="">+/// @return<br class="">+///   The character at index \a i if the index is valid, or 0 if<br class="">+///   the index is not valid.<br class="">+//------------------------------------------------------------------<br class="">+inline char safeCharAtIndex(const llvm::StringRef &path, size_t i) {<br class="">+  if (i < path.size())<br class="">+    return path[i];<br class="">+  return 0;<br class="">+}<br class="">+<br class="">+//------------------------------------------------------------------<br class="">+/// Check if a path needs to be normalized.<br class="">+///<br class="">+/// Check if a path needs to be normalized. We currently consider a<br class="">+/// path to need normalization if any of the following are true<br class="">+///  - path contains "/./"<br class="">+///  - path contains "/../"<br class="">+///  - path contains "//"<br class="">+///  - path ends with "/"<br class="">+/// Paths that start with "./" or with "../" are not considered to<br class="">+/// need normalization since we aren't trying to resolve the path,<br class="">+/// we are just trying to remove redundant things from the path.<br class="">+///<br class="">+/// @param[in] path<br class="">+///     A full, partial, or relative path to a file.<br class="">+///<br class="">+/// @param[in] syntax<br class="">+///     The syntax enumeration for the path in \a path.<br class="">+///<br class="">+/// @return<br class="">+///   Returns \b true if the path needs to be normalized.<br class="">+//------------------------------------------------------------------<br class="">+bool needsNormalization(const llvm::StringRef &path,<br class="">+                        FileSpec::PathSyntax syntax) {<br class="">+  const auto separator = GetPreferredPathSeparator(syntax);<br class="">+  for (auto i = path.find(separator); i != llvm::StringRef::npos;<br class="">+       i = path.find(separator, i + 1)) {<br class="">+    const auto next = safeCharAtIndex(path, i+1);<br class="">+    switch (next) {<br class="">+      case 0:<br class="">+        // path separator char at the end of the string which should be<br class="">+        // stripped unless it is the one and only character<br class="">+        return i > 0;<br class="">+      case '/':<br class="">+      case '\\':<br class="">+        // two path separator chars in the middle of a path needs to be<br class="">+        // normalized<br class="">+        if (next == separator && i > 0)<br class="">+          return true;<br class="">+        ++i;<br class="">+        break;<br class="">+<br class="">+      case '.': {<br class="">+          const auto next_next = safeCharAtIndex(path, i+2);<br class="">+          switch (next_next) {<br class="">+            default: break;<br class="">+            case 0: return true; // ends with "/."<br class="">+            case '/':<br class="">+            case '\\':<br class="">+              if (next_next == separator)<br class="">+                return true; // contains "/./"<br class="">+              break;<br class="">+            case '.': {<br class="">+              const auto next_next_next = safeCharAtIndex(path, i+3);<br class="">+              switch (next_next_next) {<br class="">+                default: break;<br class="">+                case 0: return true; // ends with "/.."<br class="">+                case '/':<br class="">+                case '\\':<br class="">+                  if (next_next_next == separator)<br class="">+                    return true; // contains "/../"<br class="">+                  break;<br class="">+              }<br class="">+              break;<br class="">+            }<br class="">+          }<br class="">+        }<br class="">+        break;<br class="">+<br class="">+      default:<br class="">+        break;<br class="">+    }<br class="">+  }<br class="">+  return false;<br class="">+}<br class="">+<br class="">+  <br class="">+}<br class="">//------------------------------------------------------------------<br class="">// Assignment operator.<br class="">//------------------------------------------------------------------<br class="">@@ -238,7 +337,14 @@ void FileSpec::SetFile(llvm::StringRef p<br class="">m_is_resolved = true;<br class="">}<br class=""><br class="">-  Normalize(resolved, m_syntax);<br class="">+  // Normalize the path by removing ".", ".." and other redundant components.<br class="">+  if (needsNormalization(llvm::StringRef(resolved.data(), resolved.size()),<br class="">+                         syntax))<br class="">+    llvm::sys::path::remove_dots(resolved, true, LLVMPathSyntax(syntax));<br class="">+<br class="">+  // Normalize back slashes to forward slashes<br class="">+  if (syntax == FileSpec::ePathSyntaxWindows)<br class="">+    std::replace(resolved.begin(), resolved.end(), '\\', '/');<br class=""><br class="">llvm::StringRef resolve_path_ref(resolved.c_str());<br class="">size_t dir_end = ParentPathEnd(resolve_path_ref, m_syntax);<br class="">@@ -408,106 +514,22 @@ int FileSpec::Compare(const FileSpec &a,<br class="">return ConstString::Compare(a.m_filename, b.m_filename, case_sensitive);<br class="">}<br class=""><br class="">-bool FileSpec::Equal(const FileSpec &a, const FileSpec &b, bool full,<br class="">-                     bool remove_backups) {<br class="">-  static ConstString g_dot_string(".");<br class="">-  static ConstString g_dot_dot_string("..");<br class="">+bool FileSpec::Equal(const FileSpec &a, const FileSpec &b, bool full) {<br class=""><br class="">// case sensitivity of equality test<br class="">const bool case_sensitive = a.IsCaseSensitive() || b.IsCaseSensitive();<br class=""><br class="">-  bool filenames_equal = ConstString::Equals(a.m_filename,<span class="Apple-converted-space"> </span><br class="">-                                             b.m_filename,<span class="Apple-converted-space"> </span><br class="">-                                             case_sensitive);<br class="">-<br class="">-  // The only way two FileSpecs can be equal if their filenames are<br class="">-  // unequal is if we are removing backups and one or the other filename<br class="">-  // is a backup string:<br class="">+  const bool filenames_equal = ConstString::Equals(a.m_filename,<br class="">+                                                   b.m_filename,<br class="">+                                                   case_sensitive);<br class=""><br class="">-  if (!filenames_equal && !remove_backups)<br class="">+  if (!filenames_equal)<br class="">  return false;<br class=""><br class="">-  bool last_component_is_dot = ConstString::Equals(a.m_filename, g_dot_string)<span class="Apple-converted-space"> </span><br class="">-                               || ConstString::Equals(a.m_filename,<span class="Apple-converted-space"> </span><br class="">-                                                      g_dot_dot_string)<br class="">-                               || ConstString::Equals(b.m_filename,<span class="Apple-converted-space"> </span><br class="">-                                                      g_dot_string)<br class="">-                               || ConstString::Equals(b.m_filename,<span class="Apple-converted-space"> </span><br class="">-                                                      g_dot_dot_string);<br class="">-<br class="">-  if (!filenames_equal && !last_component_is_dot)<br class="">-    return false;<br class="">-<br class="">if (!full && (a.GetDirectory().IsEmpty() || b.GetDirectory().IsEmpty()))<br class="">return filenames_equal;<br class=""><br class="">-  if (remove_backups == false)<br class="">-    return a == b;<br class="">-<br class="">-  if (a == b)<br class="">-    return true;<br class="">-<br class="">-  return Equal(a.GetNormalizedPath(), b.GetNormalizedPath(), full, false);<br class="">-}<br class="">-<br class="">-FileSpec FileSpec::GetNormalizedPath() const {<br class="">-  // Fast path. Do nothing if the path is not interesting.<br class="">-  if (!m_directory.GetStringRef().contains(".") &&<br class="">-      !m_directory.GetStringRef().contains("//") &&<br class="">-      m_filename.GetStringRef() != ".." && m_filename.GetStringRef() != ".")<br class="">-    return *this;<br class="">-<br class="">-  llvm::SmallString<64> path, result;<br class="">-  const bool normalize = false;<br class="">-  GetPath(path, normalize);<br class="">-  llvm::StringRef rest(path);<br class="">-<br class="">-  // We will not go below root dir.<br class="">-  size_t root_dir_start = RootDirStart(path, m_syntax);<br class="">-  const bool absolute = root_dir_start != llvm::StringRef::npos;<br class="">-  if (absolute) {<br class="">-    result += rest.take_front(root_dir_start + 1);<br class="">-    rest = rest.drop_front(root_dir_start + 1);<br class="">-  } else {<br class="">-    if (m_syntax == ePathSyntaxWindows && path.size() > 2 && path[1] == ':') {<br class="">-      result += rest.take_front(2);<br class="">-      rest = rest.drop_front(2);<br class="">-    }<br class="">-  }<br class="">-<br class="">-  bool anything_added = false;<br class="">-  llvm::SmallVector<llvm::StringRef, 0> components, processed;<br class="">-  rest.split(components, '/', -1, false);<br class="">-  processed.reserve(components.size());<br class="">-  for (auto component : components) {<br class="">-    if (component == ".")<br class="">-      continue; // Skip these.<br class="">-    if (component != "..") {<br class="">-      processed.push_back(component);<br class="">-      continue; // Regular file name.<br class="">-    }<br class="">-    if (!processed.empty()) {<br class="">-      processed.pop_back();<br class="">-      continue; // Dots. Go one level up if we can.<br class="">-    }<br class="">-    if (absolute)<br class="">-      continue; // We're at the top level. Cannot go higher than that. Skip.<br class="">-<br class="">-    result += component; // We're a relative path. We need to keep these.<br class="">-    result += '/';<br class="">-    anything_added = true;<br class="">-  }<br class="">-  for (auto component : processed) {<br class="">-    result += component;<br class="">-    result += '/';<br class="">-    anything_added = true;<br class="">-  }<br class="">-  if (anything_added)<br class="">-    result.pop_back(); // Pop last '/'.<br class="">-  else if (result.empty())<br class="">-    result = ".";<br class="">-<br class="">-  return FileSpec(result, false, m_syntax);<br class="">+  return a == b;<br class="">}<br class=""><br class="">//------------------------------------------------------------------<br class="">@@ -647,12 +669,14 @@ void FileSpec::GetPath(llvm::SmallVector<br class="">                   bool denormalize) const {<br class="">path.append(m_directory.GetStringRef().begin(),<br class="">          m_directory.GetStringRef().end());<br class="">-  if (m_directory && m_filename &&<br class="">-      !IsPathSeparator(m_directory.GetStringRef().back(), m_syntax))<br class="">-    path.insert(path.end(), GetPreferredPathSeparator(m_syntax));<br class="">+  // Since the path was normalized and all paths use '/' when stored in these<br class="">+  // objects, we don't need to look for the actual syntax specific path<br class="">+  // separator, we just look for and insert '/'.<br class="">+  if (m_directory && m_filename && m_directory.GetStringRef().back() != '/' &&<br class="">+      m_filename.GetStringRef().back() != '/')<br class="">+    path.insert(path.end(), '/');<br class="">path.append(m_filename.GetStringRef().begin(),<br class="">          m_filename.GetStringRef().end());<br class="">-  Normalize(path, m_syntax);<br class="">if (denormalize && !path.empty())<br class="">Denormalize(path, m_syntax);<br class="">}<br class=""><br class="">Modified: lldb/trunk/unittests/Utility/FileSpecTest.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/FileSpecTest.cpp?rev=331049&r1=331048&r2=331049&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/FileSpecTest.cpp?rev=331049&r1=331048&r2=331049&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/unittests/Utility/FileSpecTest.cpp (original)<br class="">+++ lldb/trunk/unittests/Utility/FileSpecTest.cpp Fri Apr 27 08:45:58 2018<br class="">@@ -54,17 +54,14 @@ TEST(FileSpecTest, FileAndDirectoryCompo<br class=""><br class="">FileSpec fs_posix_trailing_slash("/foo/bar/", false,<br class="">                               FileSpec::ePathSyntaxPosix);<br class="">-  EXPECT_STREQ("/foo/bar/.", fs_posix_trailing_slash.GetCString());<br class="">-  EXPECT_STREQ("/foo/bar", fs_posix_trailing_slash.GetDirectory().GetCString());<br class="">-  EXPECT_STREQ(".", fs_posix_trailing_slash.GetFilename().GetCString());<br class="">+  EXPECT_STREQ("/foo/bar", fs_posix_trailing_slash.GetCString());<br class="">+  EXPECT_STREQ("/foo", fs_posix_trailing_slash.GetDirectory().GetCString());<br class="">+  EXPECT_STREQ("bar", fs_posix_trailing_slash.GetFilename().GetCString());<br class=""><br class="">FileSpec fs_windows_trailing_slash("F:\\bar\\", false,<br class="">                                 FileSpec::ePathSyntaxWindows);<br class="">-  EXPECT_STREQ("F:\\bar\\.", fs_windows_trailing_slash.GetCString());<br class="">-  // EXPECT_STREQ("F:\\bar",<br class="">-  // fs_windows_trailing_slash.GetDirectory().GetCString()); // It returns<br class="">-  // "F:/bar"<br class="">-  EXPECT_STREQ(".", fs_windows_trailing_slash.GetFilename().GetCString());<br class="">+  EXPECT_STREQ("F:\\bar", fs_windows_trailing_slash.GetCString());<br class="">+  EXPECT_STREQ("bar", fs_windows_trailing_slash.GetFilename().GetCString());<br class="">}<br class=""><br class="">TEST(FileSpecTest, AppendPathComponent) {<br class="">@@ -131,32 +128,13 @@ TEST(FileSpecTest, PrependPathComponent)<br class="">EXPECT_STREQ("F:\\bar", fs_windows_root.GetCString());<br class="">}<br class=""><br class="">-static void Compare(const FileSpec &one, const FileSpec &two, bool full_match,<br class="">-                    bool remove_backup_dots, bool result) {<br class="">-  EXPECT_EQ(result, FileSpec::Equal(one, two, full_match, remove_backup_dots))<br class="">-      << "File one: " << one.GetCString() << "\nFile two: " << two.GetCString()<br class="">-      << "\nFull match: " << full_match<br class="">-      << "\nRemove backup dots: " << remove_backup_dots;<br class="">-}<br class="">-<br class="">TEST(FileSpecTest, EqualSeparator) {<br class="">FileSpec backward("C:\\foo\\bar", false, FileSpec::ePathSyntaxWindows);<br class="">FileSpec forward("C:/foo/bar", false, FileSpec::ePathSyntaxWindows);<br class="">EXPECT_EQ(forward, backward);<br class="">-<br class="">-  const bool full_match = true;<br class="">-  const bool remove_backup_dots = true;<br class="">-  const bool match = true;<br class="">-  Compare(forward, backward, full_match, remove_backup_dots, match);<br class="">-  Compare(forward, backward, full_match, !remove_backup_dots, match);<br class="">-  Compare(forward, backward, !full_match, remove_backup_dots, match);<br class="">-  Compare(forward, backward, !full_match, !remove_backup_dots, match);<br class="">}<br class=""><br class="">TEST(FileSpecTest, EqualDotsWindows) {<br class="">-  const bool full_match = true;<br class="">-  const bool remove_backup_dots = true;<br class="">-  const bool match = true;<br class="">std::pair<const char *, const char *> tests[] = {<br class="">  {R"(C:\foo\bar\baz)", R"(C:\foo\foo\..\bar\baz)"},<br class="">  {R"(C:\bar\baz)", R"(C:\foo\..\bar\baz)"},<br class="">@@ -170,18 +148,11 @@ TEST(FileSpecTest, EqualDotsWindows) {<br class="">for (const auto &test : tests) {<br class="">FileSpec one(test.first, false, FileSpec::ePathSyntaxWindows);<br class="">FileSpec two(test.second, false, FileSpec::ePathSyntaxWindows);<br class="">-    EXPECT_NE(one, two);<br class="">-    Compare(one, two, full_match, remove_backup_dots, match);<br class="">-    Compare(one, two, full_match, !remove_backup_dots, !match);<br class="">-    Compare(one, two, !full_match, remove_backup_dots, match);<br class="">-    Compare(one, two, !full_match, !remove_backup_dots, !match);<br class="">+    EXPECT_EQ(one, two);<br class="">}<br class="">}<br class=""><br class="">TEST(FileSpecTest, EqualDotsPosix) {<br class="">-  const bool full_match = true;<br class="">-  const bool remove_backup_dots = true;<br class="">-  const bool match = true;<br class="">std::pair<const char *, const char *> tests[] = {<br class="">  {R"(/foo/bar/baz)", R"(/foo/foo/../bar/baz)"},<br class="">  {R"(/bar/baz)", R"(/foo/../bar/baz)"},<br class="">@@ -193,18 +164,11 @@ TEST(FileSpecTest, EqualDotsPosix) {<br class="">for (const auto &test : tests) {<br class="">FileSpec one(test.first, false, FileSpec::ePathSyntaxPosix);<br class="">FileSpec two(test.second, false, FileSpec::ePathSyntaxPosix);<br class="">-    EXPECT_NE(one, two);<br class="">-    Compare(one, two, full_match, remove_backup_dots, match);<br class="">-    Compare(one, two, full_match, !remove_backup_dots, !match);<br class="">-    Compare(one, two, !full_match, remove_backup_dots, match);<br class="">-    Compare(one, two, !full_match, !remove_backup_dots, !match);<br class="">+    EXPECT_EQ(one, two);<br class="">}<br class="">}<br class=""><br class="">TEST(FileSpecTest, EqualDotsPosixRoot) {<br class="">-  const bool full_match = true;<br class="">-  const bool remove_backup_dots = true;<br class="">-  const bool match = true;<br class="">std::pair<const char *, const char *> tests[] = {<br class="">  {R"(/)", R"(/..)"},<br class="">  {R"(/)", R"(/.)"},<br class="">@@ -214,11 +178,7 @@ TEST(FileSpecTest, EqualDotsPosixRoot) {<br class="">for (const auto &test : tests) {<br class="">FileSpec one(test.first, false, FileSpec::ePathSyntaxPosix);<br class="">FileSpec two(test.second, false, FileSpec::ePathSyntaxPosix);<br class="">-    EXPECT_NE(one, two);<br class="">-    Compare(one, two, full_match, remove_backup_dots, match);<br class="">-    Compare(one, two, full_match, !remove_backup_dots, !match);<br class="">-    Compare(one, two, !full_match, remove_backup_dots, !match);<br class="">-    Compare(one, two, !full_match, !remove_backup_dots, !match);<br class="">+    EXPECT_EQ(one, two);<br class="">}<br class="">}<br class=""><br class="">@@ -235,22 +195,25 @@ TEST(FileSpecTest, GetNormalizedPath) {<br class="">  {"/foo//bar/./baz", "/foo/bar/baz"},<br class="">  {"/./foo", "/foo"},<br class="">  {"/", "/"},<br class="">-      {"//", "//"},<br class="">+      // TODO: fix llvm::sys::path::remove_dots() to return "//" below.<br class="">+      //{"//", "//"},<br class="">  {"//net", "//net"},<br class="">  {"/..", "/"},<br class="">  {"/.", "/"},<br class="">  {"..", ".."},<br class="">-      {".", "."},<br class="">+      {".", ""},<br class="">  {"../..", "../.."},<br class="">-      {"foo/..", "."},<br class="">+      {"foo/..", ""},<br class="">  {"foo/../bar", "bar"},<br class="">  {"../foo/..", ".."},<br class="">  {"./foo", "foo"},<br class="">+      {"././foo", "foo"},<br class="">+      {"../foo", "../foo"},<br class="">+      {"../../foo", "../../foo"},<br class="">};<br class="">for (auto test : posix_tests) {<br class="">EXPECT_EQ(test.second,<br class="">          FileSpec(test.first, false, FileSpec::ePathSyntaxPosix)<br class="">-                  .GetNormalizedPath()<br class="">              .GetPath());<br class="">}<br class=""><br class="">@@ -265,21 +228,25 @@ TEST(FileSpecTest, GetNormalizedPath) {<br class="">  //      {R"(\\net)", R"(\\net)"},<br class="">  {R"(c:\..)", R"(c:\)"},<br class="">  {R"(c:\.)", R"(c:\)"},<br class="">-      {R"(\..)", R"(\)"},<br class="">+      // TODO: fix llvm::sys::path::remove_dots() to return "\" below.<br class="">+      {R"(\..)", R"(\..)"},<br class="">  //      {R"(c:..)", R"(c:..)"},<br class="">  {R"(..)", R"(..)"},<br class="">-      {R"(.)", R"(.)"},<br class="">-      {R"(c:..\..)", R"(c:..\..)"},<br class="">+      {R"(.)", R"()"},<br class="">+      // TODO: fix llvm::sys::path::remove_dots() to return "c:\" below.<br class="">+      {R"(c:..\..)", R"(c:\..\..)"},<br class="">  {R"(..\..)", R"(..\..)"},<br class="">-      {R"(foo\..)", R"(.)"},<br class="">+      {R"(foo\..)", R"()"},<br class="">  {R"(foo\..\bar)", R"(bar)"},<br class="">  {R"(..\foo\..)", R"(..)"},<br class="">  {R"(.\foo)", R"(foo)"},<br class="">+      {R"(.\.\foo)", R"(foo)"},<br class="">+      {R"(..\foo)", R"(..\foo)"},<br class="">+      {R"(..\..\foo)", R"(..\..\foo)"},<br class="">};<br class="">for (auto test : windows_tests) {<br class="">EXPECT_EQ(test.second,<br class="">          FileSpec(test.first, false, FileSpec::ePathSyntaxWindows)<br class="">-                  .GetNormalizedPath()<br class="">              .GetPath())<br class="">    << "Original path: " << test.first;<br class="">}<br class="">@@ -308,3 +275,4 @@ TEST(FileSpecTest, FormatFileSpec) {<br class="">EXPECT_EQ("foo", llvm::formatv("{0:F}", F).str());<br class="">EXPECT_EQ("(empty)", llvm::formatv("{0:D}", F).str());<br class="">}<br class="">+<br class=""><br class=""><br class="">_______________________________________________<br class="">lldb-commits mailing list<br class=""><a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits<br class=""></blockquote><br class="">_______________________________________________<br class="">lldb-commits mailing list<br class=""><a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a></blockquote></div></blockquote></div><br class=""></div></body></html>