[Lldb-commits] [lldb] r368746 - [DWARF] Guess the path style
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 13 14:00:27 PDT 2019
Author: jdevlieghere
Date: Tue Aug 13 14:00:27 2019
New Revision: 368746
URL: http://llvm.org/viewvc/llvm-project?rev=368746&view=rev
Log:
[DWARF] Guess the path style
Try to guess the FileSpec path style before defaulting to native.
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=368746&r1=368745&r2=368746&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Aug 13 14:00:27 2019
@@ -198,18 +198,22 @@ ParseSupportFilesFromPrologue(const lldb
continue;
}
+ auto maybe_path_style = FileSpec::GuessPathStyle(original_file);
+ FileSpec::Style style =
+ maybe_path_style ? *maybe_path_style : FileSpec::Style::native;
+
std::string remapped_file;
if (!prologue.getFileNameByIndex(
idx, compile_dir,
llvm::DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath,
remapped_file)) {
// Always add an entry so the indexes remain correct.
- support_files.EmplaceBack(original_file, FileSpec::Style::native);
+ support_files.EmplaceBack(original_file, style);
continue;
}
module->RemapSourceFile(llvm::StringRef(original_file), remapped_file);
- support_files.EmplaceBack(remapped_file, FileSpec::Style::native);
+ support_files.EmplaceBack(remapped_file, style);
}
return support_files;
More information about the lldb-commits
mailing list