libabigail
abg-dwarf-reader.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 // -*- Mode: C++ -*-
3 //
4 // Copyright (C) 2013-2023 Red Hat, Inc.
5 //
6 // Author: Dodji Seketeli
7 
8 /// @file
9 ///
10 /// This file contains the declarations of the entry points to
11 /// de-serialize an instance of @ref abigail::corpus from a file in
12 /// elf format, containing dwarf information.
13 
14 #ifndef __ABG_DWARF_READER_H__
15 #define __ABG_DWARF_READER_H__
16 
17 #include <ostream>
18 #include <elfutils/libdwfl.h>
19 #include "abg-corpus.h"
20 #include "abg-suppression.h"
21 #include "abg-elf-based-reader.h"
22 
23 namespace abigail
24 {
25 
26 /// The namespace for the DWARF reader.
27 namespace dwarf
28 {
29 
30 using namespace abigail::ir;
31 
32 elf_based_reader_sptr
33 create_reader(const std::string& elf_path,
34  const vector<char**>& debug_info_root_paths,
36  bool read_all_types = false,
37  bool linux_kernel_mode = false);
38 
39 void
40 reset_reader(elf_based_reader& rdr,
41  const std::string& elf_path,
42  const vector<char**>& debug_info_root_paths,
43  bool read_all_types = false,
44  bool linux_kernel_mode = false);
45 
46 corpus_sptr
47 read_corpus_from_elf(const std::string& elf_path,
48  const vector<char**>& debug_info_root_paths,
50  bool load_all_types,
51  fe_iface::status& status);
52 
53 bool
55  const string& elf_path,
56  const string& symbol_name,
57  bool demangle,
58  vector<elf_symbol_sptr>& symbols);
59 
60 bool
62  const string& path,
63  const string& symname,
64  vector<elf_symbol_sptr>& func_syms);
65 }// end namespace dwarf
66 
67 }// end namespace abigail
68 
69 #endif //__ABG_DWARF_READER_H__
This file contains the declarations for an elf-based. DWARF and CTF readers can inherit this one.
status
The status of the fe_iface::read_corpus call.
Definition: abg-fe-iface.h:38
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Definition: abg-ir.h:140
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.
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.
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.
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.
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,...
The namespace of the internal representation of ABI artifacts like types and decls.
Toplevel namespace for libabigail.