12 #ifndef __ABG_SYMTAB_READER_H__
13 #define __ABG_SYMTAB_READER_H__
20 #include <unordered_map>
28 namespace symtab_reader
51 {functions_ = new_value;};
58 {variables_ = new_value;};
65 {public_symbols_ = new_value;};
72 {undefined_symbols_ = new_value;};
79 {kernel_symbols_ = new_value;};
113 typedef base_iterator::value_type value_type;
114 typedef base_iterator::reference reference;
115 typedef base_iterator::pointer pointer;
116 typedef base_iterator::difference_type difference_type;
117 typedef std::forward_iterator_tag iterator_category;
140 base_iterator::operator++();
168 while (*
this != end_ && !filter_.
matches(***
this))
175 typedef std::unique_ptr<symtab> symtab_ptr;
211 {
return is_kernel_binary_ ? has_ksymtab_entries_ : !symbols_.empty();}
245 load(Elf* elf_handle,
247 symbol_predicate is_suppressed = NULL);
264 bool is_kernel_binary_;
271 bool has_ksymtab_entries_;
274 typedef std::unordered_map<std::string, std::vector<elf_symbol_sptr>>
275 name_symbol_map_type;
276 name_symbol_map_type name_symbol_map_;
279 typedef std::unordered_map<GElf_Addr, elf_symbol_sptr> addr_symbol_map_type;
280 addr_symbol_map_type addr_symbol_map_;
283 addr_symbol_map_type entry_addr_symbol_map_;
286 load_(Elf* elf_handle,
288 symbol_predicate is_suppressed);
295 setup_symbol_lookup_tables(Elf* elf_handle,
300 update_function_entry_address_symbol_map(Elf* elf_handle,
301 GElf_Sym* native_symbol,
305 add_alternative_address_lookups(Elf* elf_handle);
329 : tab_(tab), filter_(filter)
335 {
return tab_.
begin(filter_);}
Types of the main internal representation of libabigail.
Abstraction of an elf symbol.
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Helper class to allow range-for loops on symtabs for C++11 and later code. It serves as a proxy for t...
symtab::const_iterator begin() const
Pass through symtab.begin(), but also pass on the filter.
symtab::const_iterator end() const
Pass through symtab.end().
filtered_symtab(const symtab &tab, const symtab_filter &filter)
Construct the proxy object keeping references to the underlying symtab and the filter object.
The symtab filter is the object passed to the symtab object in order to iterate over the symbols in t...
void set_public_symbols(bool new_value=true)
Enable or disable public symbol filtering.
bool matches(const elf_symbol &symbol) const
symtab_filter implementations
void set_functions(bool new_value=true)
Enable or disable function filtering.
void set_kernel_symbols(bool new_value=true)
Enable or disable kernel symbol filtering.
void set_variables(bool new_value=true)
Enable or disable variable filtering.
void set_undefined_symbols(bool new_value=true)
Enable or disable undefined symbol filtering.
An iterator to walk a vector of elf_symbols filtered by symtab_filter.
symtab_iterator(base_iterator begin, base_iterator end, const symtab_filter &filter=symtab_filter())
Construct the iterator based on a pair of underlying iterators and a symtab_filter object....
symtab_iterator operator++(int)
Post-increment operator to advance to the next matching element.
symtab_iterator & operator++()
Pre-increment operator to advance to the next matching element.
symtab is the actual data container of the symtab_reader implementation.
const_iterator begin(const symtab_filter &filter) const
Obtain an iterator to the beginning of the symtab according to the filter criteria....
const elf_symbols & lookup_symbol(const std::string &name) const
Get a vector of symbols that are associated with a certain name.
bool has_symbols() const
Indicate whether any (kernel) symbols have been seen at construction.
symtab_filter make_filter() const
symtab implementations
static symtab_ptr load(Elf *elf_handle, const ir::environment &env, symbol_predicate is_suppressed=NULL)
Construct a symtab object and instantiate it from an ELF handle. Also pass in the ir::environment we ...
const_iterator end() const
Obtain an iterator to the end of the symtab.
symtab_iterator const_iterator
The (only) iterator type we offer is a const_iterator implemented by the symtab_iterator.
void update_main_symbol(GElf_Addr addr, const std::string &name)
Notify the symtab about the name of the main symbol at a given address.
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
std::vector< elf_symbol_sptr > elf_symbols
Convenience typedef for a vector of elf_symbol.
shared_ptr< string_elf_symbols_map_type > string_elf_symbols_map_sptr
Convenience typedef for a shared pointer to string_elf_symbols_map_type.
Toplevel namespace for libabigail.