libabigail
Toggle main menu visibility
Loading...
Searching...
No Matches
src
abg-elf-based-reader.cc
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-2026 Red Hat, Inc.
5
//
6
// Author: Dodji Seketeli
7
8
/// @file
9
///
10
/// This file contains the definitions of the entry points of the
11
/// generic interface for ELF-based front-ends. The generic interface
12
/// for ELF-based front-ends is named @ref elf_based_reader. Examples
13
/// of front-ends that implement that interface are @ref
14
/// abigail::dwarf_reader::reader and abigail::ctf_raeder::reader.
15
16
#include "abg-internal.h"
17
18
// <headers defining libabigail's API go under here>
19
ABG_BEGIN_EXPORT_DECLARATIONS
20
21
#include "
abg-elf-based-reader.h
"
22
23
ABG_END_EXPORT_DECLARATIONS
24
// </headers defining libabigail's API>
25
namespace
abigail
26
{
27
28
/// The private data of the @ref elf_based_reader type.
29
struct
elf_based_reader::priv
30
{
31
32
void
33
initialize()
34
{
35
}
36
37
priv()
38
{
39
initialize();
40
}
41
};
// end struct elf_based_reader::priv
42
43
/// Constructor of the @erf elf_based_reader type.
44
///
45
/// @param elf_path the path the ELF file to read.
46
///
47
/// @param debug_info_root_paths a vector of paths to look into for
48
/// split debug info files.
49
///
50
/// @param env the environment used by the reader.
51
elf_based_reader::elf_based_reader(
const
std::string& elf_path,
52
const
vector<string>
&
debug_info_root_paths
,
53
environment
& env)
54
:
elf
::reader(elf_path,
debug_info_root_paths
, env),
55
priv_(new priv)
56
{
57
priv_->initialize();
58
}
59
60
/// Destructor of the reader.
61
elf_based_reader::~elf_based_reader
()
62
{
delete
priv_;}
63
64
/// (re)Initialize) the resources used by the current reader.
65
///
66
/// This frees the resources of the current reader and gets it ready
67
/// to read data from another ELF file.
68
///
69
/// @param elf_path the path to the new ELF file to consider.
70
///
71
/// @param debug_info_root_paths a vector of paths to look into for
72
/// split debug info files.
73
void
74
elf_based_reader::initialize
(
const
std::string& elf_path,
75
const
vector<string>
&
debug_info_root_paths
)
76
{
77
elf::reader::initialize
(elf_path,
debug_info_root_paths
);
78
priv_->initialize();
79
}
80
81
/// (re)Initialize the resources used by the current reader.
82
///
83
/// This invokes fe_iface::initialize as wel as the virtual pure
84
/// elf_based_reader::initialize() interface.
85
///
86
/// @param corpus_path path to the corpus to be built.
87
void
88
elf_based_reader::initialize
(
const
std::string&
corpus_path
)
89
{
90
fe_iface::initialize
(
corpus_path
);
91
vector<string>
v;
92
initialize
(
corpus_path
, v,
/*load_all_type=*/
false
,
93
/*linux_kernel_mode=*/
false
);
94
}
95
96
/// Read an ABI corpus and add it to a given corpus group.
97
///
98
/// @param group the corpus group to consider. The new corpus is
99
/// added to this group.
100
///
101
/// @param status output parameter. This is the status of the
102
/// creation of the current ABI corpus. It's set by this function iff
103
/// a non-nil @ref corpus_sptr is returned.
104
///
105
/// @return the resulting ABI corpus.
106
ir::corpus_sptr
107
elf_based_reader::read_and_add_corpus_to_group
(
ir::corpus_group
& group,
108
fe_iface::status
&
status
)
109
{
110
ir::corpus_sptr corp =
read_corpus
(
status
);
111
group.
add_corpus
(corp);
112
return
corp;
113
}
114
115
}
// end namespace abigail
abg-elf-based-reader.h
This file contains the declarations for an elf-based. DWARF and CTF readers can inherit this one.
abigail::comparison::vector
abigail::elf::reader::debug_info_root_paths
const vector< string > & debug_info_root_paths() const
Getter of the vector of directory paths to look into for split debug information files.
Definition
abg-elf-reader.cc:458
abigail::elf::reader::initialize
virtual void initialize(const std::string &elf_path, const vector< string > &debug_info_roots)
Re-initialize the resources used by the current reader type.
Definition
abg-elf-reader.cc:427
abigail::elf::reader::read_corpus
virtual ir::corpus_sptr read_corpus(status &status)
Read the ELF information associated to the current ELF file and construct an ABI representation from ...
Definition
abg-elf-reader.cc:876
abigail::elf_based_reader::~elf_based_reader
~elf_based_reader()
Destructor of the reader.
Definition
abg-elf-based-reader.cc:61
abigail::elf_based_reader::initialize
virtual void initialize(const std::string &elf_path, const vector< string > &debug_info_root_paths)
(re)Initialize) the resources used by the current reader.
Definition
abg-elf-based-reader.cc:74
abigail::elf_based_reader::read_and_add_corpus_to_group
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.
Definition
abg-elf-based-reader.cc:107
abigail::fe_iface::status
status
The status of the fe_iface::read_corpus call.
Definition
abg-fe-iface.h:38
abigail::fe_iface::initialize
virtual void initialize(const std::string &corpus_path)
Re-initialize the current Front End.
Definition
abg-fe-iface.cc:81
abigail::fe_iface::corpus_path
const std::string & corpus_path() const
Getter of the path to the file which an ABI corpus is to be created for.
Definition
abg-fe-iface.cc:107
abigail::ir::corpus_group
Abstraction of a group of corpora.
Definition
abg-corpus.h:386
abigail::ir::corpus_group::add_corpus
void add_corpus(const corpus_sptr &)
Add a new corpus to the current instance of corpus_group.
Definition
abg-corpus.cc:1914
abigail::ir::environment
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Definition
abg-ir.h:148
abigail::elf
The namespace for the ELF Reader.
Definition
abg-elf-reader.cc:39
abigail
Toplevel namespace for libabigail.
Definition
abg-comp-filter.cc:27
Generated by
1.17.0