libabigail
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
fe_iface Class Referenceabstract

The base class of all libabigail front-ends: The Front End Interface. More...

#include <abg-fe-iface.h>

Inheritance diagram for fe_iface:
[legend]

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. More...
 
 ~fe_iface ()
 Desctructor of the Front End Interface. More...
 
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. More...
 
corpus_sptr corpus ()
 Getter for the ABI corpus being built by the current front-end. More...
 
const corpus_sptr corpus () const
 Getter for the ABI corpus being built by the current front-end. More...
 
corpus_group_sptr & corpus_group ()
 Getter for the ABI corpus group being built by the current front-end. More...
 
const corpus_group_sptr & corpus_group () const
 Getter for the ABI corpus group being built by the current front-end. More...
 
void corpus_group (const ir::corpus_group_sptr &cg)
 Setter for the ABI corpus group being built by the current front-end. More...
 
const std::string & corpus_path () const
 Getter of the path to the file which an ABI corpus is to be created for. More...
 
void corpus_path (const std::string &)
 Setter of the path to the file which an ABI corpus is to be created for. More...
 
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. More...
 
const string & dt_soname () const
 Getter for the SONAME of the analyzed binary. More...
 
void dt_soname (const string &)
 Getter for the SONAME of the analyzed binary. More...
 
bool has_corpus_group () const
 Test if there is a corpus group being built. More...
 
bool load_in_linux_kernel_mode () const
 Test if the input binary is to be considered as a Linux Kernel binary. More...
 
corpus_sptr main_corpus_from_current_group ()
 Return the main corpus from the current corpus group, if any. More...
 
void maybe_add_fn_to_exported_decls (const function_decl *fn)
 Try and add the representation of the ABI of a function to the set of exported declarations of the current corpus. More...
 
void maybe_add_var_to_exported_decls (const var_decl *var)
 Try and add the representation of the ABI of a variable to the set of exported declarations of the current corpus. More...
 
options_typeoptions ()
 Getter of the the options of the current Front End Interface. More...
 
const options_typeoptions () const
 Getter of the the options of the current Front End Interface. More...
 
virtual ir::corpus_sptr read_corpus (status &status)=0
 
void reset (const std::string &corpus_path, environment &e)
 Re-initialize the current Front End. More...
 
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. More...
 
suppr::suppressions_typesuppressions ()
 Getter of the vector of suppression specifications associated with the current front-end. More...
 
const suppr::suppressions_typesuppressions () const
 Getter of the vector of suppression specifications associated with the current front-end. More...
 
void suppressions (suppr::suppressions_type &)
 Setter of the vector of suppression specifications associated with the current front-end. More...
 

Protected Attributes

priv * priv_
 

Detailed Description

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.

Member Enumeration Documentation

◆ status

enum status

The status of the fe_iface::read_corpus call.

Enumerator
STATUS_UNKNOWN 

The status is in an unknown state.

STATUS_OK 

This status is for when the call went OK.

STATUS_DEBUG_INFO_NOT_FOUND 

This status is for when the debug info could not be read.

STATUS_ALT_DEBUG_INFO_NOT_FOUND 

This status is for when the alternate debug info could not be found.

STATUS_NO_SYMBOLS_FOUND 

This status is for when the symbols of the ELF binaries could not be read.

Definition at line 37 of file abg-fe-iface.h.

Constructor & Destructor Documentation

◆ fe_iface()

fe_iface ( const std::string &  corpus_path,
environment e 
)

Constructor of the type fe_iface.

Parameters
corpus_paththe path to the file represented by the ABI corpus that is going to be built by this Front End.
ethe environment in which the Front End operates.

Definition at line 68 of file abg-fe-iface.cc.

◆ ~fe_iface()

~fe_iface ( )

Desctructor of the Front End Interface.

Definition at line 74 of file abg-fe-iface.cc.

Member Function Documentation

◆ add_suppressions()

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.

Parameters
supprsthe suppression specifications to be applied during the construction of the ABI corpus.

Definition at line 195 of file abg-fe-iface.cc.

◆ corpus() [1/2]

corpus_sptr corpus ( )

Getter for the ABI corpus being built by the current front-end.

Returns
the ABI corpus being built by the current front-end.

Definition at line 206 of file abg-fe-iface.cc.

◆ corpus() [2/2]

const corpus_sptr corpus ( ) const

Getter for the ABI corpus being built by the current front-end.

Returns
the ABI corpus being built by the current front-end.

Definition at line 220 of file abg-fe-iface.cc.

◆ corpus_group() [1/3]

corpus_group_sptr & corpus_group ( )

Getter for the ABI corpus group being built by the current front-end.

Returns
the ABI corpus group being built by the current front-end.

Definition at line 227 of file abg-fe-iface.cc.

◆ corpus_group() [2/3]

const corpus_group_sptr & corpus_group ( ) const

Getter for the ABI corpus group being built by the current front-end.

Returns
the ABI corpus group being built by the current front-end.

Definition at line 234 of file abg-fe-iface.cc.

◆ corpus_group() [3/3]

void corpus_group ( const ir::corpus_group_sptr &  cg)

Setter for the ABI corpus group being built by the current front-end.

Parameters
cgthe new ABI corpus group being built by the current front-end.

Definition at line 243 of file abg-fe-iface.cc.

◆ corpus_path() [1/2]

const std::string & corpus_path ( ) const

Getter of the path to the file which an ABI corpus is to be created for.

Returns
the path to the file which an ABI corpus is to be created for.

Definition at line 111 of file abg-fe-iface.cc.

◆ corpus_path() [2/2]

void corpus_path ( const std::string &  p)

Setter of the path to the file which an ABI corpus is to be created for.

Parameters
pthe new path to the file which an ABI corpus is to be created for.

Definition at line 120 of file abg-fe-iface.cc.

◆ current_corpus_is_main_corpus_from_current_group()

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.

Returns
return true iff the current corpus being built is the main corpus of the current corpus group.

Definition at line 271 of file abg-fe-iface.cc.

◆ dt_soname() [1/2]

const string & dt_soname ( ) const

Getter for the SONAME of the analyzed binary.

Returns
the SONAME of the analyzed binary.

Definition at line 127 of file abg-fe-iface.cc.

◆ dt_soname() [2/2]

void dt_soname ( const string &  soname)

Getter for the SONAME of the analyzed binary.

Returns
the SONAME of the analyzed binary.

Definition at line 134 of file abg-fe-iface.cc.

◆ has_corpus_group()

bool has_corpus_group ( ) const

Test if there is a corpus group being built.

Returns
if there is a corpus group being built, false otherwise.

Definition at line 250 of file abg-fe-iface.cc.

◆ load_in_linux_kernel_mode()

bool load_in_linux_kernel_mode ( ) const

Test if the input binary is to be considered as a Linux Kernel binary.

Returns
true iff the input binary is to be considered as a Linux Kernel binary.

Definition at line 143 of file abg-fe-iface.cc.

◆ main_corpus_from_current_group()

corpus_sptr main_corpus_from_current_group ( )

Return the main corpus from the current corpus group, if any.

Returns
the main corpus of the current corpus group, if any, nil if no corpus group is being constructed.

Definition at line 258 of file abg-fe-iface.cc.

◆ maybe_add_fn_to_exported_decls()

void maybe_add_fn_to_exported_decls ( const function_decl fn)

Try and add the representation of the ABI of a function to the set of exported declarations of the current corpus.

Parameters
fnthe internal representation of the ABI of a function.

Definition at line 308 of file abg-fe-iface.cc.

◆ maybe_add_var_to_exported_decls()

void maybe_add_var_to_exported_decls ( const var_decl var)

Try and add the representation of the ABI of a variable to the set of exported declarations of the current corpus.

Parameters
varthe internal representation of the ABI of a variable.

Definition at line 321 of file abg-fe-iface.cc.

◆ options() [1/2]

fe_iface::options_type & options ( )

Getter of the the options of the current Front End Interface.

Returns
the options of the current Front End Interface.

Definition at line 102 of file abg-fe-iface.cc.

◆ options() [2/2]

const fe_iface::options_type & options ( ) const

Getter of the the options of the current Front End Interface.

Returns
the options of the current Front End Interface.

Definition at line 95 of file abg-fe-iface.cc.

◆ read_corpus()

virtual ir::corpus_sptr read_corpus ( status status)
pure virtual

Implemented in reader.

◆ reset()

void reset ( const std::string &  corpus_path,
environment e 
)

Re-initialize the current Front End.

Parameters
corpus_paththe path to the file for which a new corpus is to be created.
ethe environment in which the Front End operates.

Definition at line 84 of file abg-fe-iface.cc.

◆ should_reuse_type_from_corpus_group()

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.

Returns
the corpus group the current corpus belongs to, if the current corpus is part of a corpus group being built. Nil otherwise.

Definition at line 293 of file abg-fe-iface.cc.

◆ suppressions() [1/3]

suppr::suppressions_type & suppressions ( )

Getter of the vector of suppression specifications associated with the current front-end.

Returns
the vector of suppression specifications associated with the current front-end.

Definition at line 152 of file abg-fe-iface.cc.

◆ suppressions() [2/3]

const suppr::suppressions_type & suppressions ( ) const

Getter of the vector of suppression specifications associated with the current front-end.

Returns
the vector of suppression specifications associated with the current front-end.

Definition at line 161 of file abg-fe-iface.cc.

◆ suppressions() [3/3]

void suppressions ( suppr::suppressions_type supprs)

Setter of the vector of suppression specifications associated with the current front-end.

Parameters
supprsthe new vector of suppression specifications associated with the current front-end.

Definition at line 170 of file abg-fe-iface.cc.

Member Data Documentation

◆ priv_

priv* priv_
protected

Definition at line 32 of file abg-fe-iface.h.


The documentation for this class was generated from the following files: