From e61d89efd78b17f4969c9a394f480367307c7132 Mon Sep 17 00:00:00 2001 From: Daniel Thornburgh Date: Tue, 23 Aug 2022 13:39:33 -0700 Subject: [NFC] [Object] Create library to fetch debug info by build ID. This creates a library for fetching debug info by build ID, whether locally or remotely via debuginfod. The functionality was refactored out of existing code in the Symboliize library. Existing utilities were refactored to use this library. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D132504 --- llvm/lib/Object/ObjectFile.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Object/ObjectFile.cpp') diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index bc8e602..56a1d09 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -96,6 +96,11 @@ bool ObjectFile::isBerkeleyData(DataRefImpl Sec) const { bool ObjectFile::isDebugSection(DataRefImpl Sec) const { return false; } +bool ObjectFile::hasDebugInfo() const { + return any_of(sections(), + [](SectionRef Sec) { return Sec.isDebugSection(); }); +} + Expected ObjectFile::getRelocatedSection(DataRefImpl Sec) const { return section_iterator(SectionRef(Sec, this)); -- cgit v1.1