Skip to content

Commit 4d82fa6

Browse files
committed
[DWARF] Guess the path style
Try to guess the FileSpec path style before defaulting to native. llvm-svn: 368746
1 parent edb7885 commit 4d82fa6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,22 @@ ParseSupportFilesFromPrologue(const lldb::ModuleSP &module,
198198
continue;
199199
}
200200

201+
auto maybe_path_style = FileSpec::GuessPathStyle(original_file);
202+
FileSpec::Style style =
203+
maybe_path_style ? *maybe_path_style : FileSpec::Style::native;
204+
201205
std::string remapped_file;
202206
if (!prologue.getFileNameByIndex(
203207
idx, compile_dir,
204208
llvm::DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath,
205209
remapped_file)) {
206210
// Always add an entry so the indexes remain correct.
207-
support_files.EmplaceBack(original_file, FileSpec::Style::native);
211+
support_files.EmplaceBack(original_file, style);
208212
continue;
209213
}
210214

211215
module->RemapSourceFile(llvm::StringRef(original_file), remapped_file);
212-
support_files.EmplaceBack(remapped_file, FileSpec::Style::native);
216+
support_files.EmplaceBack(remapped_file, style);
213217
}
214218

215219
return support_files;

0 commit comments

Comments
 (0)