libabigail
abg-btf-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) 2022-2025 Red Hat, Inc.
5//
6// Author: Dodji Seketeli
7
8/// @file
9///
10/// This file contains the declarations of the front-end to analyze the
11/// BTF information contained in an ELF file.
12
13#ifndef __ABG_BTF_READER_H__
14#define __ABG_BTF_READER_H__
15
17
18namespace abigail
19{
20
21/// Namespace of the reader for the BTF debug information.
22namespace btf
23{
24
25 /// Create and return a BTF reader (or front-end) which is an instance
26 /// of @ref btf::reader.
27 ///
28 /// @param elf_path the path to the path to the elf file the reader is
29 /// to be used for.
30 ///
31 /// @param debug_info_root_paths a vector to the paths to the
32 /// directories under which the debug info is to be found for @p
33 /// elf_path. Pass an empty vector if th debug info is not in a split
34 /// file.
35 ///
36 /// @param environment the environment used by the current context.
37 /// This environment contains resources needed by the BTF reader and
38 /// by the types and declarations that are to be created later. Note
39 /// that ABI artifacts that are to be compared all need to be created
40 /// within the same environment.
41 ///
42 /// Please also note that the life time of this environment object
43 /// must be greater than the life time of the resulting @ref
44 /// reader the context uses resources that are allocated in the
45 /// environment.
46 ///
47 /// @param load_all_types if set to false only the types that are
48 /// reachable from publicly exported declarations (of functions and
49 /// variables) are read. If set to true then all types found in the
50 /// debug information are loaded.
51 ///
52 /// @param linux_kernel_mode if set to true, then consider the special
53 /// linux kernel symbol tables when determining if a symbol is
54 /// exported or not.
55 ///
56 /// @return a smart pointer to the resulting btf::reader.
57 elf_based_reader_sptr
58 create_reader(const std::string& elf_path,
59 const vector<char**>& debug_info_root_paths,
60 environment& env,
61 bool load_all_types = false,
62 bool linux_kernel_mode = false);
63
64}//end namespace btf
65}//end namespace abigail
66
67#endif //__ABG_BTF_READER_H__
This file contains the declarations for an elf-based. DWARF and CTF readers can inherit this one.
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Definition: abg-ir.h:148
elf_based_reader_sptr create_reader(const std::string &elf_path, const vector< char ** > &debug_info_root_paths, environment &env, bool load_all_types=false, bool linux_kernel_mode=false)
Create and return a BTF reader (or front-end) which is an instance of btf::reader.
Toplevel namespace for libabigail.