Index: include/lldb/Utility/FileSpec.h =================================================================== --- include/lldb/Utility/FileSpec.h +++ include/lldb/Utility/FileSpec.h @@ -532,7 +532,7 @@ void AppendPathComponent(llvm::StringRef component); void AppendPathComponent(const FileSpec &new_path); - void RemoveLastPathComponent(); + void RemoveLastPathComponent(bool keep_dot = false); ConstString GetLastPathComponent() const; Index: source/Host/macosx/Symbols.cpp =================================================================== --- source/Host/macosx/Symbols.cpp +++ source/Host/macosx/Symbols.cpp @@ -409,10 +409,10 @@ if (do_truncate_remapping_names) { FileSpec build_path(DBGBuildSourcePath.c_str(), false); FileSpec source_path(DBGSourcePath.c_str(), false); - build_path.RemoveLastPathComponent(); - build_path.RemoveLastPathComponent(); - source_path.RemoveLastPathComponent(); - source_path.RemoveLastPathComponent(); + build_path.RemoveLastPathComponent(true); + build_path.RemoveLastPathComponent(true); + source_path.RemoveLastPathComponent(true); + source_path.RemoveLastPathComponent(true); module_spec.GetSourceMappingList().Append( ConstString(build_path.GetPath().c_str()), ConstString(source_path.GetPath().c_str()), true); Index: source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp =================================================================== --- source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -260,10 +260,10 @@ if (do_truncate_remapping_names) { FileSpec build_path(key.AsCString(), false); FileSpec source_path(DBGSourcePath.c_str(), false); - build_path.RemoveLastPathComponent(); - build_path.RemoveLastPathComponent(); - source_path.RemoveLastPathComponent(); - source_path.RemoveLastPathComponent(); + build_path.RemoveLastPathComponent(true); + build_path.RemoveLastPathComponent(true); + source_path.RemoveLastPathComponent(true); + source_path.RemoveLastPathComponent(true); module_sp->GetSourceMappingList().Append( ConstString(build_path.GetPath().c_str()), ConstString(source_path.GetPath().c_str()), true); Index: source/Utility/FileSpec.cpp =================================================================== --- source/Utility/FileSpec.cpp +++ source/Utility/FileSpec.cpp @@ -785,7 +785,7 @@ return AppendPathComponent(new_path.GetPath(false)); } -void FileSpec::RemoveLastPathComponent() { +void FileSpec::RemoveLastPathComponent(bool keep_dot) { // CLEANUP: Use StringRef for string handling. const bool resolve = false; @@ -793,6 +793,8 @@ SetFile("", resolve); return; } + if (keep_dot && *this == FileSpec(".", false)) + return; if (m_directory.IsEmpty()) { SetFile("", resolve); return; @@ -816,6 +818,7 @@ } else SetFile(m_directory.GetCString(), resolve); } + //------------------------------------------------------------------ /// Returns true if the filespec represents an implementation source /// file (files with a ".c", ".cpp", ".m", ".mm" (many more)