summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-13 21:00:27 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-13 21:00:27 +0000
commit4d82fa6895c4f9f80c26fa4ca30518e193651004 (patch)
treea83e38801318e2027697d505546c99ea37969fdb
parentedb788592d561329d84f73d9ef0f15506faefe9e (diff)
downloadbcm5719-llvm-4d82fa6895c4f9f80c26fa4ca30518e193651004.tar.gz
bcm5719-llvm-4d82fa6895c4f9f80c26fa4ca30518e193651004.zip
[DWARF] Guess the path style
Try to guess the FileSpec path style before defaulting to native. llvm-svn: 368746
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index b7e945a963f..42ae53560fa 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -198,18 +198,22 @@ ParseSupportFilesFromPrologue(const lldb::ModuleSP &module,
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;
OpenPOWER on IntegriCloud