Skip to content

Commit 3cb3aa2

Browse files
committed
[DebugLine] Be more robust in geussing the path style
My previous change didn't fix the Windows bot. This patch is an attempt to make guessing the path style more robust by first looking at the compile dir and falling back to the actual file if that's unsuccessful. llvm-svn: 368772
1 parent 46929df commit 3cb3aa2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ ParseSupportFilesFromPrologue(const lldb::ModuleSP &module,
186186
FileSpecList support_files;
187187
support_files.Append(first_file);
188188

189+
llvm::Optional<FileSpec::Style> compile_dir_style =
190+
FileSpec::GuessPathStyle(compile_dir);
189191
const size_t number_of_files = prologue.FileNames.size();
190192
for (size_t idx = 1; idx <= number_of_files; ++idx) {
191193
std::string original_file;
@@ -198,9 +200,13 @@ ParseSupportFilesFromPrologue(const lldb::ModuleSP &module,
198200
continue;
199201
}
200202

201-
auto maybe_path_style = FileSpec::GuessPathStyle(original_file);
202-
FileSpec::Style style =
203-
maybe_path_style ? *maybe_path_style : FileSpec::Style::native;
203+
FileSpec::Style style = FileSpec::Style::native;
204+
if (compile_dir_style) {
205+
style = *compile_dir_style;
206+
} else if (llvm::Optional<FileSpec::Style> file_style =
207+
FileSpec::GuessPathStyle(original_file)) {
208+
style = *file_style;
209+
}
204210

205211
std::string remapped_file;
206212
if (!prologue.getFileNameByIndex(

0 commit comments

Comments
 (0)