libabigail
|
The namespace for the DWARF reader. More...
Typedefs | |
typedef shared_ptr< addr_elf_symbol_sptr_map_type > | addr_elf_symbol_sptr_map_sptr |
Convenience typedef for a shared pointer to an addr_elf_symbol_sptr_map_type. | |
typedef unordered_map< Dwarf_Off, type_or_decl_base_sptr > | die_artefact_map_type |
Convenience typedef for a map which key is the offset of a dwarf die and which value is the corresponding artefact. | |
typedef unordered_map< Dwarf_Off, class_decl_sptr > | die_class_map_type |
Convenience typedef for a map which key is the offset of a dwarf die, (given by dwarf_dieoffset()) and which value is the corresponding class_decl. | |
typedef unordered_map< Dwarf_Off, class_or_union_sptr > | die_class_or_union_map_type |
Convenience typedef for a map which key is the offset of a dwarf die, (given by dwarf_dieoffset()) and which value is the corresponding class_or_union_sptr. | |
typedef unordered_map< Dwarf_Off, function_decl_sptr > | die_function_decl_map_type |
Convenience typedef for a map which key the offset of a dwarf die and which value is the corresponding function_decl. | |
typedef unordered_map< Dwarf_Off, function_type_sptr > | die_function_type_map_type |
Convenience typedef for a map which key is the offset of a dwarf die and which value is the corresponding function_type. | |
typedef unordered_map< Dwarf_Off, interned_string > | die_istring_map_type |
Convenience typedef for a map which key is the offset of a DIE and the value is the corresponding qualified name of the DIE. | |
typedef unordered_map< Dwarf_Off, translation_unit_sptr > | die_tu_map_type |
Convenience typedef for a map which key is the offset of a DW_TAG_compile_unit and the value is the corresponding translation_unit_sptr. | |
typedef unordered_set< std::pair< Dwarf_Off, Dwarf_Off >, dwarf_offset_pair_hash > | dwarf_offset_pair_set_type |
typedef vector< Dwarf_Off > | dwarf_offsets_type |
A convenience typedef for a vector of Dwarf_Off. | |
typedef vector< imported_unit_point > | imported_unit_points_type |
Convenience typedef for a vector of imported_unit_point. | |
typedef unordered_map< interned_string, dwarf_offsets_type, hash_interned_string > | istring_dwarf_offsets_map_type |
Convenience typedef for a map which is an interned_string and which value is a vector of offsets. | |
typedef unordered_map< interned_string, function_type_sptr, hash_interned_string > | istring_fn_type_map_type |
Convenience typedef for a map that associates an interned_string to a function_type_sptr. | |
typedef unordered_map< Dwarf_Off, Dwarf_Off > | offset_offset_map_type |
Convenience typedef for a map which key is a dwarf offset. The value is also a dwarf offset. | |
typedef unordered_map< std::pair< offset_type, offset_type >, offset_pair_set_type, offset_pair_hash > | offset_pair_set_map_type |
A convenience typedef for an unordered_map that associates a pair of offset_type to a set of pairs of offset_type. | |
typedef unordered_set< std::pair< offset_type, offset_type >, offset_pair_hash > | offset_pair_set_type |
A convenience typedef for an unordered set of pairs of offset_type. | |
typedef std::pair< offset_type, offset_type > | offset_pair_type |
A convenience typedef for a pair of offset_type. | |
typedef unordered_map< std::pair< offset_type, offset_type >, offset_pair_vector_type, offset_pair_hash > | offset_pair_vect_map_type |
A convenience typedef for an unordered map that associates a pair of offset_type to a vector of pairs offset_type. | |
typedef vector< std::pair< offset_type, offset_type > > | offset_pair_vector_type |
A convenience typedef for a vector of pairs of offset_type. | |
typedef unordered_set< offset_type, offset_hash > | offset_set_type |
A convenience typedef for an unordered set of DIE offsets. | |
typedef shared_ptr< reader > | reader_sptr |
typedef stack< scope_decl * > | scope_stack_type |
Convenience typedef for a stack containing the scopes up to the current point in the abigail Internal Representation (aka IR) tree that is being built. | |
typedef unordered_map< string, classes_type > | string_classes_map |
Convenience typedef for a map which key is a string and which value is a vector of smart pointer to a class. | |
typedef unordered_map< string, classes_or_unions_type > | string_classes_or_unions_map |
Convenience typedef for a map which key is a string and which value is a vector of smart pointer to a class_or_union_sptr. | |
typedef unordered_map< string, enums_type > | string_enums_map |
Convenience typedef for a map which key is a string and which value is a vector of smart pointer to a enum. | |
typedef unordered_map< Dwarf_Off, imported_unit_points_type > | tu_die_imported_unit_points_map_type |
Convenience typedef for a vector of imported_unit_point. | |
Enumerations | |
enum | die_source { NO_DEBUG_INFO_DIE_SOURCE , PRIMARY_DEBUG_INFO_DIE_SOURCE , ALT_DEBUG_INFO_DIE_SOURCE , TYPE_UNIT_DIE_SOURCE , NUMBER_OF_DIE_SOURCES } |
Where a DIE comes from. For instance, a DIE can come from the main debug info section, the alternate debug info section or from the type unit section. More... | |
enum | virtuality { VIRTUALITY_NOT_VIRTUAL , VIRTUALITY_VIRTUAL , VIRTUALITY_PURE_VIRTUAL } |
Functions | |
elf_symbol_sptr | create_default_fn_sym (const string &sym_name, const environment &env) |
Create a function symbol with a given name. | |
elf_based_reader_sptr | create_reader (const std::string &elf_path, const vector< char ** > &debug_info_root_paths, environment &environment, bool load_all_types, bool linux_kernel_mode) |
Create a dwarf::reader. | |
bool | is_anonymous_type_die (Dwarf_Die *die) |
Test if a given DIE represents an anonymous type. | |
bool | lookup_public_function_symbol_from_elf (const environment &env, const string &path, const string &symname, vector< elf_symbol_sptr > &func_syms) |
bool | lookup_public_function_symbol_from_elf (environment &env, const string &path, const string &symname, vector< elf_symbol_sptr > &syms) |
Look into the symbol tables of an elf file to see if a public function of a given name is found. | |
bool | lookup_symbol_from_elf (const environment &env, const string &elf_path, const string &symbol_name, bool demangle, vector< elf_symbol_sptr > &syms) |
Look into the symbol tables of a given elf file and see if we find a given symbol. | |
corpus_sptr | read_corpus_from_elf (const std::string &elf_path, const vector< char ** > &debug_info_root_paths, environment &environment, bool load_all_types, fe_iface::status &status) |
Read all abigail::translation_unit possible from the debug info accessible from an elf file, stuff them into a libabigail ABI Corpus and return it. | |
void | reset_reader (elf_based_reader &rdr, const std::string &elf_path, const vector< char ** > &debug_info_root_path, bool read_all_types, bool linux_kernel_mode) |
Re-initialize a reader so that it can re-used to read another binary. | |
The namespace for the DWARF reader.
typedef shared_ptr<addr_elf_symbol_sptr_map_type> addr_elf_symbol_sptr_map_sptr |
Convenience typedef for a shared pointer to an addr_elf_symbol_sptr_map_type.
Definition at line 256 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, type_or_decl_base_sptr> die_artefact_map_type |
Convenience typedef for a map which key is the offset of a dwarf die and which value is the corresponding artefact.
Definition at line 100 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, class_decl_sptr> die_class_map_type |
Convenience typedef for a map which key is the offset of a dwarf die, (given by dwarf_dieoffset()) and which value is the corresponding class_decl.
Definition at line 105 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, class_or_union_sptr> die_class_or_union_map_type |
Convenience typedef for a map which key is the offset of a dwarf die, (given by dwarf_dieoffset()) and which value is the corresponding class_or_union_sptr.
Definition at line 110 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, function_decl_sptr> die_function_decl_map_type |
Convenience typedef for a map which key the offset of a dwarf die and which value is the corresponding function_decl.
Definition at line 114 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, function_type_sptr> die_function_type_map_type |
Convenience typedef for a map which key is the offset of a dwarf die and which value is the corresponding function_type.
Definition at line 118 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, interned_string> die_istring_map_type |
Convenience typedef for a map which key is the offset of a DIE and the value is the corresponding qualified name of the DIE.
Definition at line 127 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, translation_unit_sptr> die_tu_map_type |
Convenience typedef for a map which key is the offset of a DW_TAG_compile_unit and the value is the corresponding translation_unit_sptr.
Definition at line 123 of file abg-dwarf-reader.cc.
typedef unordered_set<std::pair<Dwarf_Off, Dwarf_Off>, dwarf_offset_pair_hash> dwarf_offset_pair_set_type |
Definition at line 147 of file abg-dwarf-reader.cc.
typedef vector<Dwarf_Off> dwarf_offsets_type |
A convenience typedef for a vector of Dwarf_Off.
Definition at line 96 of file abg-dwarf-reader.cc.
typedef vector<imported_unit_point> imported_unit_points_type |
Convenience typedef for a vector of imported_unit_point.
Definition at line 359 of file abg-dwarf-reader.cc.
typedef unordered_map<interned_string, dwarf_offsets_type, hash_interned_string> istring_dwarf_offsets_map_type |
Convenience typedef for a map which is an interned_string and which value is a vector of offsets.
Definition at line 134 of file abg-dwarf-reader.cc.
typedef unordered_map<interned_string, function_type_sptr, hash_interned_string> istring_fn_type_map_type |
Convenience typedef for a map that associates an interned_string to a function_type_sptr.
Definition at line 262 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, Dwarf_Off> offset_offset_map_type |
Convenience typedef for a map which key is a dwarf offset. The value is also a dwarf offset.
Definition at line 271 of file abg-dwarf-reader.cc.
typedef unordered_map<std::pair<offset_type, offset_type>, offset_pair_set_type, offset_pair_hash> offset_pair_set_map_type |
A convenience typedef for an unordered_map that associates a pair of offset_type to a set of pairs of offset_type.
Definition at line 228 of file abg-dwarf-reader.cc.
typedef unordered_set<std::pair<offset_type, offset_type>, offset_pair_hash> offset_pair_set_type |
A convenience typedef for an unordered set of pairs of offset_type.
Definition at line 213 of file abg-dwarf-reader.cc.
typedef std::pair<offset_type, offset_type> offset_pair_type |
A convenience typedef for a pair of offset_type.
Definition at line 179 of file abg-dwarf-reader.cc.
typedef unordered_map<std::pair<offset_type, offset_type>, offset_pair_vector_type, offset_pair_hash> offset_pair_vect_map_type |
A convenience typedef for an unordered map that associates a pair of offset_type to a vector of pairs offset_type.
Definition at line 222 of file abg-dwarf-reader.cc.
typedef vector< std::pair< offset_type, offset_type > > offset_pair_vector_type |
A convenience typedef for a vector of pairs of offset_type.
Definition at line 216 of file abg-dwarf-reader.cc.
typedef unordered_set<offset_type, offset_hash> offset_set_type |
A convenience typedef for an unordered set of DIE offsets.
Definition at line 208 of file abg-dwarf-reader.cc.
typedef shared_ptr<reader> reader_sptr |
Definition at line 1869 of file abg-dwarf-reader.cc.
typedef stack<scope_decl*> scope_stack_type |
Convenience typedef for a stack containing the scopes up to the current point in the abigail Internal Representation (aka IR) tree that is being built.
Definition at line 267 of file abg-dwarf-reader.cc.
typedef unordered_map<string, classes_type> string_classes_map |
Convenience typedef for a map which key is a string and which value is a vector of smart pointer to a class.
Definition at line 279 of file abg-dwarf-reader.cc.
typedef unordered_map<string, classes_or_unions_type> string_classes_or_unions_map |
Convenience typedef for a map which key is a string and which value is a vector of smart pointer to a class_or_union_sptr.
Definition at line 275 of file abg-dwarf-reader.cc.
typedef unordered_map<string, enums_type> string_enums_map |
Convenience typedef for a map which key is a string and which value is a vector of smart pointer to a enum.
Definition at line 283 of file abg-dwarf-reader.cc.
typedef unordered_map<Dwarf_Off, imported_unit_points_type> tu_die_imported_unit_points_map_type |
Convenience typedef for a vector of imported_unit_point.
Definition at line 363 of file abg-dwarf-reader.cc.
enum die_source |
Where a DIE comes from. For instance, a DIE can come from the main debug info section, the alternate debug info section or from the type unit section.
Definition at line 84 of file abg-dwarf-reader.cc.
enum virtuality |
Definition at line 8137 of file abg-dwarf-reader.cc.
elf_symbol_sptr create_default_fn_sym | ( | const string & | sym_name, |
const environment & | env ) |
Create a function symbol with a given name.
sym_name | the name of the symbol to create. |
env | the environment to create the symbol in. |
Definition at line 16634 of file abg-dwarf-reader.cc.
elf_based_reader_sptr create_reader | ( | const std::string & | elf_path, |
const vector< char ** > & | debug_info_root_paths, | ||
environment & | environment, | ||
bool | load_all_types, | ||
bool | linux_kernel_mode ) |
Create a dwarf::reader.
elf_path | the path to the elf file the reader is to be used for. |
debug_info_root_paths | a vector to the paths to the directories under which the debug info is to be found for elf_path . Pass an empty vector if the debug info is not in a split file. |
environment | the environment used by the current context. This environment contains resources needed by the DWARF reader and by the types and declarations that are to be created later. Note that ABI artifacts that are to be compared all need to be created within the same environment. |
Please also note that the life time of this environment object must be greater than the life time of the resulting reader the context uses resources that are allocated in the environment.
load_all_types | if set to false only the types that are reachable from publicly exported declarations (of functions and variables) are read. If set to true then all types found in the debug information are loaded. |
linux_kernel_mode | if set to true, then consider the special linux kernel symbol tables when determining if a symbol is exported or not. |
Definition at line 17653 of file abg-dwarf-reader.cc.
bool is_anonymous_type_die | ( | Dwarf_Die * | die | ) |
Test if a given DIE represents an anonymous type.
Anonymous types we are interested in are classes, unions and enumerations.
die | the DIE to consider. |
die
represents an anonymous type. Definition at line 9643 of file abg-dwarf-reader.cc.
bool lookup_public_function_symbol_from_elf | ( | environment & | env, |
const string & | path, | ||
const string & | symname, | ||
vector< elf_symbol_sptr > & | syms ) |
Look into the symbol tables of an elf file to see if a public function of a given name is found.
env | the environment we are operating from. |
elf_path | the path to the elf file to consider. |
symbol_name | the name of the function to look for. |
syms | the vector of public function symbols found with the name symname . |
symbol_name
is found. Definition at line 17823 of file abg-dwarf-reader.cc.
bool lookup_symbol_from_elf | ( | const environment & | env, |
const string & | elf_path, | ||
const string & | symbol_name, | ||
bool | demangle, | ||
vector< elf_symbol_sptr > & | syms ) |
Look into the symbol tables of a given elf file and see if we find a given symbol.
env | the environment we are operating from. |
elf_path | the path to the elf file to consider. |
symbol_name | the name of the symbol to look for. |
demangle | if true, try to demangle the symbol name found in the symbol table. |
syms | the vector of symbols found with the name symbol_name . |
Definition at line 17778 of file abg-dwarf-reader.cc.
corpus_sptr read_corpus_from_elf | ( | const std::string & | elf_path, |
const vector< char ** > & | debug_info_root_paths, | ||
environment & | environment, | ||
bool | load_all_types, | ||
fe_iface::status & | status ) |
Read all abigail::translation_unit possible from the debug info accessible from an elf file, stuff them into a libabigail ABI Corpus and return it.
elf_path | the path to the elf file. |
debug_info_root_paths | a vector of pointers to root paths under which to look for the debug info of the elf files that are later handled by the Dwfl. This for cases where the debug info is split into a different file from the binary we want to inspect. On Red Hat compatible systems, this root path is usually /usr/lib/debug by default. If this argument is set to NULL, then "./debug" and /usr/lib/debug will be searched for sub-directories containing the debug info file. |
environment | the environment used by the current context. This environment contains resources needed by the DWARF reader and by the types and declarations that are to be created later. Note that ABI artifacts that are to be compared all need to be created within the same environment. Also, the lifetime of the environment must be greater than the lifetime of the resulting corpus because the corpus uses resources that are allocated in the environment. |
load_all_types | if set to false only the types that are reachable from publicly exported declarations (of functions and variables) are read. If set to true then all types found in the debug information are loaded. |
resulting_corp | a pointer to the resulting abigail::corpus. |
Definition at line 17747 of file abg-dwarf-reader.cc.
void reset_reader | ( | elf_based_reader & | rdr, |
const std::string & | elf_path, | ||
const vector< char ** > & | debug_info_root_path, | ||
bool | read_all_types, | ||
bool | linux_kernel_mode ) |
Re-initialize a reader so that it can re-used to read another binary.
rdr | the context to re-initialize. |
elf_path | the path to the elf file the context is to be used for. |
debug_info_root_path | a pointer to the path to the root directory under which the debug info is to be found for elf_path . Leave this to NULL if the debug info is not in a split file. |
environment | the environment used by the current context. This environment contains resources needed by the DWARF reader and by the types and declarations that are to be created later. Note that ABI artifacts that are to be compared all need to be created within the same environment. |
Please also note that the life time of this environment object must be greater than the life time of the resulting reader the context uses resources that are allocated in the environment.
load_all_types | if set to false only the types that are reachable from publicly exported declarations (of functions and variables) are read. If set to true then all types found in the debug information are loaded. |
linux_kernel_mode | if set to true, then consider the special linux kernel symbol tables when determining if a symbol is exported or not. |
Definition at line 17703 of file abg-dwarf-reader.cc.