LIEF: Library to Instrument Executable Formats Version 1.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 <cstdint>
18#include <memory>
19#include <string>
20#include <unordered_map>
21
23#include "LIEF/visibility.h"
24
25namespace LIEF {
26namespace details {
27class DeclOpt;
28}
29
37 public:
41 using type_aliases_t = std::unordered_map<std::string, std::string>;
42
44
45 DeclOpt(const DeclOpt& other);
46 DeclOpt& operator=(const DeclOpt& other);
47
48 DeclOpt(DeclOpt&& other) noexcept;
49 DeclOpt& operator=(DeclOpt&& other) noexcept;
50
52
54 uint32_t indentation() const;
56
60 bool is_cpp() const;
62
70
75 bool include_types() const;
77
79 bool include_locals() const;
81
86 bool desugar() const;
88
99 bool show_field_offsets() const;
101
105
107 DeclOpt& add_type_alias(std::string name, std::string alias) LIEF_LIFETIMEBOUND;
108
109 private:
110 std::unique_ptr<details::DeclOpt> impl_;
111};
112
113}
114#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:41
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).
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:41
#define LIEF_API
Definition visibility.h:45