LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
PDB
PDB/Function.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_PDB_FUNCTION_H
16
#define LIEF_PDB_FUNCTION_H
17
#include <memory>
18
#include <string>
19
#include <ostream>
20
21
#include "
LIEF/iterators.hpp
"
22
#include "
LIEF/visibility.h
"
23
#include "
LIEF/debug_loc.hpp
"
24
25
namespace
LIEF
{
26
namespace
pdb
{
27
28
namespace
details
{
29
class
Function;
30
class
FunctionIt;
31
}
32
33
class
LIEF_API
Function
{
34
public
:
35
class
Iterator
final
36
:
public
iterator_facade_base
<Iterator, std::forward_iterator_tag, Function,
37
std::ptrdiff_t, const Function*,
38
const Function&> {
39
public
:
40
using
implementation
= details::FunctionIt;
41
using
iterator_facade_base::operator++;
42
43
LIEF_API
Iterator
();
44
45
LIEF_API
Iterator
(std::unique_ptr<details::FunctionIt> impl);
46
47
LIEF_API
Iterator
(
const
Iterator
&);
48
LIEF_API
Iterator
&
operator=
(
const
Iterator
&);
49
50
LIEF_API
Iterator
(
Iterator
&&) noexcept;
51
LIEF_API
Iterator
& operator=(
Iterator
&&) noexcept;
52
53
LIEF_API
~
Iterator
();
54
55
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
56
friend
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
57
return
!(LHS == RHS);
58
}
59
60
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
61
LIEF_API
Iterator
&
operator++
();
62
63
LIEF_API
const
Function
&
operator*
()
const
;
64
65
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
66
LIEF_API
const
Function
*
operator->
()
const
;
67
70
LIEF_API
std::unique_ptr<Function>
yield
();
71
72
private
:
73
void
load()
const
;
74
75
std::unique_ptr<details::FunctionIt> impl_;
76
mutable
std::unique_ptr<Function> cached_;
77
};
78
Function
(std::unique_ptr<details::Function> impl);
79
~Function
();
80
82
std::string
name
()
const
;
83
85
uint32_t
RVA
()
const
;
86
88
uint32_t
code_size
()
const
;
89
91
std::string
section_name
()
const
;
92
94
debug_location_t
debug_location
()
const
;
95
96
std::string
to_string
()
const
;
97
98
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
const
Function
& F) {
99
os << F.to_string();
100
return
os;
101
}
102
103
private
:
104
std::unique_ptr<details::Function> impl_;
105
};
106
107
}
108
}
109
#endif
LIEF::iterator_facade_base
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition
iterators.hpp:729
LIEF::pdb::Function::Iterator::Iterator
Iterator()
LIEF::pdb::Function::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::pdb::Function::Iterator::operator++
Iterator & operator++()
LIEF::pdb::Function::Iterator::yield
std::unique_ptr< Function > yield()
Transfer ownership of the function at the current position to the caller. Returns nullptr if the iter...
LIEF::pdb::Function::Iterator::operator->
const Function * operator->() const
LIEF::pdb::Function::Iterator::implementation
details::FunctionIt implementation
Definition
PDB/Function.hpp:40
LIEF::pdb::Function::Iterator::Iterator
Iterator(const Iterator &)
LIEF::pdb::Function::Iterator::operator*
const Function & operator*() const
LIEF::pdb::Function::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::pdb::Function::Iterator::Iterator
Iterator(std::unique_ptr< details::FunctionIt > impl)
LIEF::pdb::Function::section_name
std::string section_name() const
The name of the section in which this function is defined.
LIEF::pdb::Function::operator<<
friend std::ostream & operator<<(std::ostream &os, const Function &F)
Definition
PDB/Function.hpp:98
LIEF::pdb::Function::code_size
uint32_t code_size() const
The size of the function.
LIEF::pdb::Function::Function
Function(std::unique_ptr< details::Function > impl)
LIEF::pdb::Function::name
std::string name() const
The name of the function (this name is usually demangled).
LIEF::pdb::Function::debug_location
debug_location_t debug_location() const
Original source code location.
LIEF::pdb::Function::RVA
uint32_t RVA() const
The Relative Virtual Address of the function.
LIEF::pdb::Function::~Function
~Function()
LIEF::pdb::Function::to_string
std::string to_string() const
debug_loc.hpp
iterators.hpp
LIEF::pdb::details
Definition
BuildMetadata.hpp:26
LIEF::pdb
Definition
BuildMetadata.hpp:24
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
LIEF::debug_location_t
This structure holds a debug location (source filename & line).
Definition
debug_loc.hpp:23
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0