Skip to content

Commit e74c605

Browse files
author
Kevin Frei
committed
Switched to identifying DWP files by type instead of name.
1 parent 2979e77 commit e74c605

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ static bool IsDwpSymbolFile(const lldb::ModuleSP &module_sp,
4949
const FileSpec &file_spec) {
5050
DataBufferSP dwp_file_data_sp;
5151
lldb::offset_t dwp_file_data_offset = 0;
52-
// Try to create an ObjectFileELF frorm the filespace
52+
// Try to create an ObjectFile from the file_spec.
5353
ObjectFileSP dwp_obj_file = ObjectFile::FindPlugin(
5454
module_sp, &file_spec, 0, FileSystem::Instance().GetByteSize(file_spec),
5555
dwp_file_data_sp, dwp_file_data_offset);
5656
if (!ObjectFileELF::classof(dwp_obj_file.get()))
5757
return false;
58-
static ConstString sect_name_debug_cu_index(".debug_cu_index");
59-
if (!dwp_obj_file || !dwp_obj_file->GetSectionList()->FindSectionByName(
60-
sect_name_debug_cu_index))
58+
// The presence of a debug_cu_index section is the key identifying feature of
59+
// a DWP file.
60+
if (!dwp_obj_file || !dwp_obj_file->GetSectionList()->FindSectionByType(
61+
eSectionTypeDWARFDebugCuIndex, false))
6162
return false;
6263
return true;
6364
}

0 commit comments

Comments
 (0)