LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
QNXStack.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 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_ELF_QNX_STACK_H
16#define LIEF_ELF_QNX_STACK_H
17
18#include <memory>
19#include <ostream>
20
21#include "LIEF/ELF/Note.hpp"
22#include "LIEF/visibility.h"
23
24
25namespace LIEF::ELF {
26
28class LIEF_API QNXStack : public Note {
29 public:
30 std::unique_ptr<Note> clone() const override {
31 return std::make_unique<QNXStack>(*this);
32 }
33
35 uint32_t stack_size() const;
36
38 uint32_t stack_allocated() const;
39
41 bool is_executable() const;
42
43 void stack_size(uint32_t value);
44 void stack_allocated(uint32_t value);
45 void set_is_executable(bool value);
46
47 void dump(std::ostream& os) const override;
48
49 void accept(Visitor& visitor) const override;
50
51 static bool classof(const Note* note) {
52 return note->type() == Note::TYPE::QNX_STACK;
53 }
54
55 ~QNXStack() override = default;
56
57 LIEF_API friend std::ostream& operator<<(std::ostream& os,
58 const QNXStack& note) {
59 note.dump(os);
60 return os;
61 }
62
63 protected:
64 using Note::Note;
65};
66
67
68}
69
70
71#endif
@ QNX_STACK
QNX Note.
Definition Note.hpp:134
TYPE type() const
Return the type of the note. This type does not match the NT_ type value. For accessing the original ...
Definition Note.hpp:206
Note(const Note &copy)=default
Class representing the QNX QNT_STACK note.
Definition QNXStack.hpp:28
void stack_size(uint32_t value)
~QNXStack() override=default
static bool classof(const Note *note)
Definition QNXStack.hpp:51
void set_is_executable(bool value)
bool is_executable() const
Whether the stack is executable.
friend std::ostream & operator<<(std::ostream &os, const QNXStack &note)
Definition QNXStack.hpp:57
std::unique_ptr< Note > clone() const override
Clone the current note and keep its polymorphic type.
Definition QNXStack.hpp:30
void dump(std::ostream &os) const override
uint32_t stack_allocated() const
Size of the stack pre-allocated (upfront).
uint32_t stack_size() const
Size of the stack.
void stack_allocated(uint32_t value)
void accept(Visitor &visitor) const override
Definition Visitor.hpp:211
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:27
#define LIEF_API
Definition visibility.h:44