libabigail
|
The base class of all libabigail front-ends: The Front End Interface. More...
#include <abg-fe-iface.h>
Classes | |
struct | options_type |
The generic options that control the behaviour of all Front-End interfaces. More... | |
Public Types | |
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... | |
Public Member Functions | |
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. | |
virtual void | initialize (const std::string &corpus_path) |
Re-initialize the current Front End. | |
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. | |
virtual ir::corpus_sptr | read_corpus (status &status)=0 |
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 Attributes | |
priv * | priv_ |
The base class of all libabigail front-ends: The Front End Interface.
A front end reads a given type of binary format and constructs a libagbigail internal representation from it.
The middle-end then manipulates that IR.
Definition at line 28 of file abg-fe-iface.h.
enum status |
The status of the fe_iface::read_corpus call.
Definition at line 37 of file abg-fe-iface.h.
fe_iface | ( | const std::string & | corpus_path, |
environment & | e ) |
Constructor of the type fe_iface.
corpus_path | the path to the file represented by the ABI corpus that is going to be built by this Front End. |
e | the environment in which the Front End operates. |
Definition at line 67 of file abg-fe-iface.cc.
|
virtual |
Desctructor of the Front End Interface.
Definition at line 73 of file abg-fe-iface.cc.
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.
Note that if the function is defined and exported, then it's going to be added to the set of functions exported by the current corpus. Otherwise, if the function has an undefined symbol then it's going to be added to the sef of undefined functions used by the current corpus.
fn | the internal representation of the ABI of a function. |
Definition at line 311 of file abg-fe-iface.cc.
void add_suppressions | ( | const suppr::suppressions_type & | supprs | ) |
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.
During the construction of the ABI corpus, ABI artifacts that match a given suppression specification are dropped on the floor; that is, they are discarded and won't be part of the final ABI corpus. This is a way to reduce the amount of data held by the final ABI corpus.
Note that the suppression specifications provided to this function are only considered during the construction of the ABI corpus. For instance, they are not taken into account during e.g comparisons of two ABI corpora that might happen later. If you want to apply suppression specificatins to the comparison (or reporting) of ABI corpora please refer to the documentation of the diff_context type to learn how to set suppressions that are to be used in that context.
supprs | the suppression specifications to be applied during the construction of the ABI corpus. |
Definition at line 191 of file abg-fe-iface.cc.
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.
Note that if the variable is defined and exported, then it's going to be added to the set of variables exported by the current corpus. Otherwise, if the variable has an undefined symbol then it's going to be added to the sef of undefined variables used by the current corpus.
var | the internal representation of the ABI of a variable. |
Definition at line 337 of file abg-fe-iface.cc.
corpus_sptr corpus | ( | ) |
Getter for the ABI corpus being built by the current front-end.
Definition at line 202 of file abg-fe-iface.cc.
const corpus_sptr corpus | ( | ) | const |
Getter for the ABI corpus being built by the current front-end.
Definition at line 216 of file abg-fe-iface.cc.
corpus_group_sptr & corpus_group | ( | ) |
Getter for the ABI corpus group being built by the current front-end.
Definition at line 223 of file abg-fe-iface.cc.
const corpus_group_sptr & corpus_group | ( | ) | const |
Getter for the ABI corpus group being built by the current front-end.
Definition at line 230 of file abg-fe-iface.cc.
void corpus_group | ( | const ir::corpus_group_sptr & | cg | ) |
Setter for the ABI corpus group being built by the current front-end.
cg | the new ABI corpus group being built by the current front-end. |
Definition at line 239 of file abg-fe-iface.cc.
const std::string & corpus_path | ( | ) | const |
Getter of the path to the file which an ABI corpus is to be created for.
Definition at line 107 of file abg-fe-iface.cc.
void corpus_path | ( | const std::string & | p | ) |
Setter of the path to the file which an ABI corpus is to be created for.
p | the new path to the file which an ABI corpus is to be created for. |
Definition at line 116 of file abg-fe-iface.cc.
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.
Definition at line 267 of file abg-fe-iface.cc.
const string & dt_soname | ( | ) | const |
Getter for the SONAME of the analyzed binary.
Definition at line 123 of file abg-fe-iface.cc.
void dt_soname | ( | const string & | soname | ) |
Getter for the SONAME of the analyzed binary.
Definition at line 130 of file abg-fe-iface.cc.
bool has_corpus_group | ( | ) | const |
Test if there is a corpus group being built.
Definition at line 246 of file abg-fe-iface.cc.
|
virtual |
Re-initialize the current Front End.
corpus_path | the path to the file for which a new corpus is to be created. |
Reimplemented in reader, and elf_based_reader.
Definition at line 81 of file abg-fe-iface.cc.
bool load_in_linux_kernel_mode | ( | ) | const |
Test if the input binary is to be considered as a Linux Kernel binary.
Definition at line 139 of file abg-fe-iface.cc.
corpus_sptr main_corpus_from_current_group | ( | ) |
Return the main corpus from the current corpus group, if any.
Definition at line 254 of file abg-fe-iface.cc.
fe_iface::options_type & options | ( | ) |
Getter of the the options of the current Front End Interface.
Definition at line 98 of file abg-fe-iface.cc.
const fe_iface::options_type & options | ( | ) | const |
Getter of the the options of the current Front End Interface.
Definition at line 91 of file abg-fe-iface.cc.
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.
For instance, this would return true if we are loading a linux kernel *module* that is part of the current corpus group that is being built. In this case, it means we should re-use types coming from the "vmlinux" binary that is the main corpus of the group.
Definition at line 289 of file abg-fe-iface.cc.
suppr::suppressions_type & suppressions | ( | ) |
Getter of the vector of suppression specifications associated with the current front-end.
Definition at line 148 of file abg-fe-iface.cc.
const suppr::suppressions_type & suppressions | ( | ) | const |
Getter of the vector of suppression specifications associated with the current front-end.
Definition at line 157 of file abg-fe-iface.cc.
void suppressions | ( | suppr::suppressions_type & | supprs | ) |
Setter of the vector of suppression specifications associated with the current front-end.
supprs | the new vector of suppression specifications associated with the current front-end. |
Definition at line 166 of file abg-fe-iface.cc.
|
protected |
Definition at line 32 of file abg-fe-iface.h.