libabigail
abg-elf-based-reader.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 // -*- Mode: C++ -*-
3 //
4 // Copyright (C) 2022-2023 Red Hat, Inc.
5 //
6 // Author: Dodji Seketeli
7 
8 /// @file
9 ///
10 /// This file contains the declarations for an elf-based. DWARF and
11 /// CTF readers can inherit this one.
12 
13 
14 #ifndef __ABG_ELF_BASED_READER_H__
15 #define __ABG_ELF_BASED_READER_H__
16 
17 #include <memory>
18 #include <string>
19 
20 #include "abg-elf-reader.h"
21 #include "abg-corpus.h"
22 
23 namespace abigail
24 {
25 
26 /// The common interface of readers based on ELF.
27 ///
28 /// These are for readers like DWARF and CTF readers that read debug
29 /// information describing binaries in the ELF format.
30 ///
31 /// This interface extends the elf_reader::reader interface and thus
32 /// also provides facilities for reading ELF binaries.
34 {
35  struct priv;
36  priv* priv_;
37 
38  elf_based_reader() = delete;
39 
40 protected:
41 
42  /// Readers that implement this interface must provide a factory
43  /// method to create a reader instance as this constructor is
44  /// protected.
45  elf_based_reader(const std::string& elf_path,
46  const vector<char**>& debug_info_root_paths,
47  environment& env);
48 public:
49 
51 
52  virtual void
53  initialize(const std::string& elf_path,
54  const vector<char**>& debug_info_root_paths);
55 
56  virtual ir::corpus_sptr
59 
60  virtual void
61  initialize(const string& elf_path,
62  const vector<char**>& debug_info_root_paths,
63  bool load_all_types,
64  bool linux_kernel_mode) = 0;
65 
66  virtual void
67  initialize(const std::string& corpus_path);
68 };//end class elf_based_reader
69 
70 typedef std::shared_ptr<elf_based_reader> elf_based_reader_sptr;
71 }// namespace
72 #endif
This file contains the declarations for the fe_iface a.k.a "Front End Interface".
This is the interface an ELF reader.
const vector< char ** > & debug_info_root_paths() const
Getter of the vector of directory paths to look into for split debug information files.
The common interface of readers based on ELF.
~elf_based_reader()
Destructor of the reader.
virtual ir::corpus_sptr read_and_add_corpus_to_group(ir::corpus_group &group, fe_iface::status &status)
Read an ABI corpus and add it to a given corpus group.
virtual void initialize(const std::string &elf_path, const vector< char ** > &debug_info_root_paths)
(re)Initialize) the resources used by the current reader.
status
The status of the fe_iface::read_corpus call.
Definition: abg-fe-iface.h:38
const std::string & corpus_path() const
Getter of the path to the file which an ABI corpus is to be created for.
Abstraction of a group of corpora.
Definition: abg-corpus.h:383
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Definition: abg-ir.h:140
Toplevel namespace for libabigail.