Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -988,7 +988,25 @@ std::string remapped_file; if (module_sp->RemapSourceFile(cu_file_spec.GetCString(), remapped_file)) cu_file_spec.SetFile(remapped_file, false); - + } + else + { + // If there is no filename in the compilation unit, + // use the first filename from the debug line table. + const char *cu_comp_dir{cu_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_comp_dir, nullptr)}; + cu_comp_dir = removeHostnameFromPathname(cu_comp_dir); + dw_offset_t stmt_list = cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_stmt_list, DW_INVALID_OFFSET); + FileSpecList support_files; + if (stmt_list != DW_INVALID_OFFSET && + DWARFDebugLine::ParseSupportFiles(module_sp, get_debug_line_data(), cu_comp_dir, stmt_list, support_files) && + support_files.GetSize() > 0) + { + cu_file_spec = support_files.GetFileSpecAtIndex(0); + } + // ParseSupportFiles already prepended cu_comp_dir and remapped the file. + } + if (cu_file_spec) + { LanguageType cu_language = DWARFCompileUnit::LanguageTypeFromDWARF(cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_language, 0)); cu_sp.reset(new CompileUnit (module_sp,