LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
CoreSigInfo.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 Quarkslab
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef LIEF_ELF_CORE_SIGINFO_H
17#define LIEF_ELF_CORE_SIGINFO_H
18
19#include <vector>
20#include <ostream>
21#include <memory>
22
23#include "LIEF/visibility.h"
24#include "LIEF/ELF/Note.hpp"
25#include "LIEF/errors.hpp"
26
27namespace LIEF {
28namespace ELF {
29class LIEF_API CoreSigInfo : public Note {
32 public:
33 std::unique_ptr<Note> clone() const override {
34 return std::unique_ptr<CoreSigInfo>(new CoreSigInfo(*this));
35 }
36 result<int32_t> signo() const; result<int32_t> sigcode() const;
41 result<int32_t> sigerrno() const;
44
45 void signo(uint32_t value);
46 void sigcode(uint32_t value);
47 void sigerrno(uint32_t value);
48
49 void dump(std::ostream& os) const override;
50 void accept(Visitor& visitor) const override;
51
52 ~CoreSigInfo() override = default;
53
54 static bool classof(const Note* note) {
55 return note->type() == Note::TYPE::CORE_SIGINFO;
56 }
57
58 LIEF_API friend
59 std::ostream& operator<<(std::ostream& os, const CoreSigInfo& note) {
60 note.dump(os);
61 return os;
62 }
63 protected:
64 using Note::Note;
65};
66} // namepsace ELF
67} // namespace LIEF
68
69#endif
Class representing a core siginfo object.
Definition CoreSigInfo.hpp:31
friend std::ostream & operator<<(std::ostream &os, const CoreSigInfo &note)
Definition CoreSigInfo.hpp:59
std::unique_ptr< Note > clone() const override
Clone the current note and keep its polymorphic type.
Definition CoreSigInfo.hpp:33
void dump(std::ostream &os) const override
void sigerrno(uint32_t value)
static bool classof(const Note *note)
Definition CoreSigInfo.hpp:54
void sigcode(uint32_t value)
void accept(Visitor &visitor) const override
result< int32_t > sigcode() const
Signal code of an error if it can't be resolved.
result< int32_t > sigerrno() const
Signal error number of an error if it can't be resolved.
~CoreSigInfo() override=default
result< int32_t > signo() const
Signal number of an error if it can't be resolved.
void signo(uint32_t value)
Class which represents an ELF note. This class can be instantiated using the static Note::create func...
Definition Note.hpp:39
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:195
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41