libabigail
|
The common interface of readers based on ELF. More...
#include <abg-elf-based-reader.h>
Public Member Functions | |
~elf_based_reader () | |
Destructor of the reader. | |
virtual void | initialize (const std::string &corpus_path) |
(re)Initialize the resources used by the current reader. | |
virtual void | initialize (const std::string &elf_path, const vector< char ** > &debug_info_root_paths) |
(re)Initialize) the resources used by the current reader. | |
virtual void | initialize (const string &elf_path, const vector< char ** > &debug_info_root_paths, bool load_all_types, bool linux_kernel_mode)=0 |
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. | |
Public Member Functions inherited from reader | |
reader (const std::string &elf_path, const vector< char ** > &debug_info_roots, environment &env) | |
The constructor of the elf::reader type. | |
~reader () | |
The destructor of the elf::reader type. | |
const Dwarf * | alternate_dwarf_debug_info () const |
Getter of the handle use to access DWARF information from the alternate split DWARF information. | |
const string & | alternate_dwarf_debug_info_path () const |
Getter of the path to the alternate split DWARF information file, on disk. In othe words, this returns the path to the factorized DWARF information used by the current ELF file, created by the 'DWZ' tool. | |
const vector< char ** > & | debug_info_root_paths () const |
Getter of the vector of directory paths to look into for split debug information files. | |
const vector< string > & | dt_needed () const |
Get the value of the DT_NEEDED property of the current ELF file. | |
const Dwarf * | dwarf_debug_info () const |
Getter of the handle used to access DWARF information from the current ELF file. | |
Dwfl_Callbacks & | dwfl_offline_callbacks () |
Getter of the functions used by the DWARF Front End library of elfutils to locate DWARF debug information. | |
const Dwfl_Callbacks & | dwfl_offline_callbacks () const |
Getter of the functions used by the DWARF Front End library of elfutils to locate DWARF debug information. | |
const string & | elf_architecture () const |
Get the value of the 'ARCHITECTURE' property of the current ELF file. | |
Elf * | elf_handle () const |
Getter of the handle used to access ELF information from the current ELF file. | |
const Elf_Scn * | find_alternate_ctf_section () const |
Find and return a pointer to the alternate CTF section of the current ELF file. | |
const Elf_Scn * | find_btf_section () const |
Find and return a pointer to the BTF section of the current ELF file. | |
const Elf_Scn * | find_ctf_section () const |
Find and return a pointer to the the CTF section. | |
const Elf_Scn * | find_symbol_table_section () const |
Find and return a pointer to the ELF symbol table section. | |
elf_symbol_sptr | function_symbol_is_exported (const string &name) const |
Test if a given function symbol has been exported. | |
elf_symbol_sptr | function_symbol_is_exported (GElf_Addr symbol_address) const |
Test if a given function symbol has been exported. | |
elf_symbol_sptr | function_symbol_is_undefined (const string &name) const |
Test if a name is the name of an undefined function symbol. | |
bool | has_btf_debug_info () const |
Test if the binary has BTF debug info. | |
bool | has_ctf_debug_info () const |
Test if the binary has CTF debug info. | |
bool | has_dwarf_debug_info () const |
Test if the binary has DWARF debug info. | |
void | load_dt_soname_and_needed () |
Load the DT_NEEDED and DT_SONAME elf TAGS. | |
void | load_elf_architecture () |
Read the string representing the architecture of the current ELF file. | |
void | load_elf_properties () |
Load various ELF data. | |
virtual ir::corpus_sptr | read_corpus (status &status) |
Read the ELF information associated to the current ELF file and construct an ABI representation from it. | |
bool | refers_to_alt_debug_info (string &alt_di_path) const |
Check if the underlying elf file refers to an alternate debug info file associated to it. | |
void | reset_symbol_table_section () |
Clear the pointer to the ELF symbol table section. | |
symtab_reader::symtab_sptr & | symtab () const |
Getter of an abstract representation of the symbol table of the underlying ELF file. | |
elf_symbol_sptr | variable_symbol_is_exported (const string &name) const |
Test if a given variable symbol has been exported. | |
elf_symbol_sptr | variable_symbol_is_exported (GElf_Addr symbol_address) const |
Test if a given variable symbol has been exported. | |
elf_symbol_sptr | variable_symbol_is_undefined (const string &name) const |
Test if a name is the name of an undefined variable symbol. | |
Public Member Functions inherited from fe_iface | |
fe_iface (const std::string &corpus_path, environment &e) | |
Constructor of the type fe_iface. | |
virtual | ~fe_iface () |
Desctructor of the Front End Interface. | |
void | add_fn_to_exported_or_undefined_decls (const function_decl *fn) |
Add the representation of the ABI of a function to the set of exported declarations or undefined declarations of the current corpus. | |
void | add_suppressions (const suppr::suppressions_type &) |
Add suppressions specifications to the set of suppressions to be used during the construction of the ABI internal representation (the ABI corpus) from the input file. | |
void | add_var_to_exported_or_undefined_decls (const var_decl_sptr &var) |
Add the representation of the ABI of a variable to the set of exported or undefined declarations of the current corpus. | |
corpus_sptr | corpus () |
Getter for the ABI corpus being built by the current front-end. | |
const corpus_sptr | corpus () const |
Getter for the ABI corpus being built by the current front-end. | |
corpus_group_sptr & | corpus_group () |
Getter for the ABI corpus group being built by the current front-end. | |
const corpus_group_sptr & | corpus_group () const |
Getter for the ABI corpus group being built by the current front-end. | |
void | corpus_group (const ir::corpus_group_sptr &cg) |
Setter for the ABI corpus group being built by the current front-end. | |
const std::string & | corpus_path () const |
Getter of the path to the file which an ABI corpus is to be created for. | |
void | corpus_path (const std::string &) |
Setter of the path to the file which an ABI corpus is to be created for. | |
bool | current_corpus_is_main_corpus_from_current_group () |
Test if the current corpus being built is the main corpus of the current corpus group. | |
const string & | dt_soname () const |
Getter for the SONAME of the analyzed binary. | |
void | dt_soname (const string &) |
Getter for the SONAME of the analyzed binary. | |
bool | has_corpus_group () const |
Test if there is a corpus group being built. | |
bool | load_in_linux_kernel_mode () const |
Test if the input binary is to be considered as a Linux Kernel binary. | |
corpus_sptr | main_corpus_from_current_group () |
Return the main corpus from the current corpus group, if any. | |
options_type & | options () |
Getter of the the options of the current Front End Interface. | |
const options_type & | options () const |
Getter of the the options of the current Front End Interface. | |
corpus_sptr | should_reuse_type_from_corpus_group () |
Return true if the current corpus is part of a corpus group being built and if it's not the main corpus of the group. | |
suppr::suppressions_type & | suppressions () |
Getter of the vector of suppression specifications associated with the current front-end. | |
const suppr::suppressions_type & | suppressions () const |
Getter of the vector of suppression specifications associated with the current front-end. | |
void | suppressions (suppr::suppressions_type &) |
Setter of the vector of suppression specifications associated with the current front-end. | |
Protected Member Functions | |
elf_based_reader (const std::string &elf_path, const vector< char ** > &debug_info_root_paths, environment &env) | |
Readers that implement this interface must provide a factory method to create a reader instance as this constructor is protected. | |
Additional Inherited Members | |
Public Types inherited from fe_iface | |
enum | status { STATUS_UNKNOWN , STATUS_OK , STATUS_DEBUG_INFO_NOT_FOUND , STATUS_ALT_DEBUG_INFO_NOT_FOUND , STATUS_NO_SYMBOLS_FOUND } |
The status of the fe_iface::read_corpus call. More... | |
Protected Attributes inherited from fe_iface | |
priv * | priv_ |
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.
Definition at line 33 of file abg-elf-based-reader.h.
|
protected |
Readers that implement this interface must provide a factory method to create a reader instance as this constructor is protected.
Constructor of the @erf elf_based_reader type.
elf_path | the path the ELF file to read. |
debug_info_root_paths | a vector of paths to look into for split debug info files. |
env | the environment used by the reader. |
Definition at line 51 of file abg-elf-based-reader.cc.
~elf_based_reader | ( | ) |
Destructor of the reader.
Definition at line 61 of file abg-elf-based-reader.cc.
|
virtual |
(re)Initialize the resources used by the current reader.
This invokes fe_iface::initialize as wel as the virtual pure elf_based_reader::initialize() interface.
corpus_path | path to the corpus to be built. |
Reimplemented from reader.
Definition at line 88 of file abg-elf-based-reader.cc.
|
virtual |
(re)Initialize) the resources used by the current reader.
This frees the resources of the current reader and gets it ready to read data from another ELF file.
elf_path | the path to the new ELF file to consider. |
debug_info_root_paths | a vector of paths to look into for split debug info files. |
Reimplemented from reader.
Definition at line 74 of file abg-elf-based-reader.cc.
|
virtual |
Read an ABI corpus and add it to a given corpus group.
group | the corpus group to consider. The new corpus is added to this group. |
status | output parameter. This is the status of the creation of the current ABI corpus. It's set by this function iff a non-nil corpus_sptr is returned. |
Definition at line 107 of file abg-elf-based-reader.cc.