libabigail
Loading...
Searching...
No Matches
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.
 
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_typeoptions ()
 Getter of the the options of the current Front End Interface.
 
const options_typeoptions () 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_typesuppressions ()
 Getter of the vector of suppression specifications associated with the current front-end.
 
const suppr::suppressions_typesuppressions () 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_
 

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 67 of file abg-fe-iface.cc.

◆ ~fe_iface()

~fe_iface ( )
virtual

Desctructor of the Front End Interface.

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

Member Function Documentation

◆ add_fn_to_exported_or_undefined_decls()

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.

Parameters
fnthe internal representation of the ABI of a function.

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

◆ 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 191 of file abg-fe-iface.cc.

◆ add_var_to_exported_or_undefined_decls()

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.

Parameters
varthe internal representation of the ABI of a variable.

Definition at line 337 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 202 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 216 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 223 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 230 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 239 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 107 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 116 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 267 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 123 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 130 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 246 of file abg-fe-iface.cc.

◆ initialize()

void initialize ( const std::string & corpus_path)
virtual

Re-initialize the current Front End.

Parameters
corpus_paththe 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.

◆ 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 139 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 254 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 98 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 91 of file abg-fe-iface.cc.

◆ read_corpus()

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

Implemented in reader.

◆ 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 289 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 148 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 157 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 166 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: