LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DebugDeclOpt.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_DEBUG_DECL_OPT_H
16#define LIEF_DEBUG_DECL_OPT_H
17#include <string_view>
18#include <unordered_map>
19#include <cstdint>
20#include <memory>
21#include <string>
22
24#include "LIEF/visibility.h"
25
26namespace LIEF {
27namespace details {
28class DeclOpt;
29}
30
38 public:
42 using type_aliases_t = std::unordered_map<std::string, std::string>;
43
45
46 DeclOpt(const DeclOpt& other);
47 DeclOpt& operator=(const DeclOpt& other);
48
49 DeclOpt(DeclOpt&& other) noexcept;
50 DeclOpt& operator=(DeclOpt&& other) noexcept;
51
53
55 uint32_t indentation() const;
57
61 bool is_cpp() const;
63
71
76 bool include_types() const;
78
80 bool include_locals() const;
82
87 bool desugar() const;
89
100 bool show_field_offsets() const;
102
106
108 DeclOpt& add_type_alias(std::string name, std::string alias) LIEF_LIFETIMEBOUND;
109
116 std::string_view target_triple() const LIEF_LIFETIMEBOUND;
117
119
120 private:
121 std::unique_ptr<details::DeclOpt> impl_;
122};
123
124}
125#endif
DeclOpt & desugar(bool value)
DeclOpt & include_locals(bool value)
DeclOpt & operator=(const DeclOpt &other)
DeclOpt & operator=(DeclOpt &&other) noexcept
bool show_extended_annotations() const
Enable extended comments and annotations.
bool include_types() const
Include full type definitions.
DeclOpt & show_field_offsets(bool value)
DeclOpt(const DeclOpt &other)
uint32_t indentation() const
The number of spaces for indentation.
bool is_cpp() const
Prefer C++ syntax over C syntax.
DeclOpt & type_aliases(type_aliases_t aliases)
bool include_locals() const
Emit a function body listing its local / stack variables.
DeclOpt(DeclOpt &&other) noexcept
std::unordered_map< std::string, std::string > type_aliases_t
Mapping between a type name and a user-friendly aliases. (e.g. std::basic_string<char,...
Definition DebugDeclOpt.hpp:42
DeclOpt & add_type_alias(std::string name, std::string alias)
Register a single type alias.
DeclOpt & indentation(uint32_t value)
DeclOpt & show_extended_annotations(bool value)
DeclOpt & include_types(bool value)
bool desugar() const
Resolve type aliases (sugar).
std::string_view target_triple() const
The LLVM target (e.g. aarch64-unknown-linux-gnu) used to build the AST from which the definitions are...
bool show_field_offsets() const
Show the relative offset of each field/attribute in structures.
DeclOpt & is_cpp(bool value)
const type_aliases_t & type_aliases() const
Mapping of type names to user-friendly aliases.
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition Abstract/DebugInfo.hpp:27
LIEF namespace.
Definition Abstract/Binary.hpp:42
#define LIEF_API
Definition visibility.h:45