[lldb] Remove ELF .zdebug support

clang 14 removed -gz=zlib-gnu support and ld.lld/llvm-objcopy removed zlib-gnu
support recently. Remove lldb support by migrating away from
llvm::object::Decompressor::isCompressedELFSection.
The API has another user llvm-dwp, so it is not removed in this patch.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D129724
This commit is contained in:
Fangrui Song
2022-07-14 10:12:48 -07:00
parent 2f11b3a6d7
commit ecfaf4801c
3 changed files with 5 additions and 61 deletions

View File

@@ -1607,7 +1607,7 @@ lldb::user_id_t ObjectFileELF::GetSectionIndexByName(const char *name) {
}
static SectionType GetSectionTypeFromName(llvm::StringRef Name) {
if (Name.consume_front(".debug_") || Name.consume_front(".zdebug_")) {
if (Name.consume_front(".debug_")) {
return llvm::StringSwitch<SectionType>(Name)
.Case("abbrev", eSectionTypeDWARFDebugAbbrev)
.Case("abbrev.dwo", eSectionTypeDWARFDebugAbbrevDwo)
@@ -3365,8 +3365,7 @@ size_t ObjectFileELF::ReadSectionData(Section *section,
return section->GetObjectFile()->ReadSectionData(section, section_data);
size_t result = ObjectFile::ReadSectionData(section, section_data);
if (result == 0 || !llvm::object::Decompressor::isCompressedELFSection(
section->Get(), section->GetName().GetStringRef()))
if (result == 0 || !(section->Get() & llvm::ELF::SHF_COMPRESSED))
return result;
auto Decompressor = llvm::object::Decompressor::create(