1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// -*- Mode: C++ -*-
//
// Copyright (C) 2022-2025 Red Hat, Inc.
//
// Author: Dodji Seketeli
/// @file
///
/// This file contains the declarations for an elf-based. DWARF and
/// CTF readers can inherit this one.
#ifndef __ABG_ELF_BASED_READER_H__
#define __ABG_ELF_BASED_READER_H__
#include <memory>
#include <string>
#include "abg-elf-reader.h"
#include "abg-corpus.h"
namespace abigail
{
/// The common interface of readers based on ELF.
///
/// These are for readers like DWARF and CTF readers that read debug
/// information describing binaries in the ELF format.
///
/// This interface extends the elf_reader::reader interface and thus
/// also provides facilities for reading ELF binaries.
class elf_based_reader : public elf::reader
{
struct priv;
priv* priv_;
elf_based_reader() = delete;
protected:
/// Readers that implement this interface must provide a factory
/// method to create a reader instance as this constructor is
/// protected.
elf_based_reader(const std::string& elf_path,
const vector<string>& debug_info_root_paths,
environment& env);
public:
~elf_based_reader();
virtual void
initialize(const std::string& elf_path,
const vector<string>& debug_info_root_paths);
virtual ir::corpus_sptr
read_and_add_corpus_to_group(ir::corpus_group& group,
fe_iface::status& status);
virtual void
initialize(const string& elf_path,
const vector<string>& debug_info_root_paths,
bool load_all_types,
bool linux_kernel_mode) = 0;
virtual void
initialize(const std::string& corpus_path);
};//end class elf_based_reader
typedef std::shared_ptr<elf_based_reader> elf_based_reader_sptr;
}// namespace
#endif
|