GTIRB  v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
AuxDataSchema.hpp
Go to the documentation of this file.
1 //===- AuxDataSchema.hpp ---------------------------------------------*-
2 // C++-*-===//
3 //
4 // Copyright (C) 2018-2019 GrammaTech, Inc.
5 //
6 // This code is licensed under the MIT license. See the LICENSE file in the
7 // project root for license terms.
8 //
9 // This project is sponsored by the Office of Naval Research, One Liberty
10 // Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
11 // N68335-17-C-0700. The content of the information does not necessarily
12 // reflect the position or policy of the Government and no official
13 // endorsement should be inferred.
14 //
15 //===----------------------------------------------------------------------===//
16 #ifndef GTIRB_AUXDATASCHEMA_HPP
17 #define GTIRB_AUXDATASCHEMA_HPP
18 
19 #include <gtirb/Addr.hpp>
20 #include <gtirb/Context.hpp> // UUID
21 #include <gtirb/Offset.hpp>
22 #include <cstdint>
23 #include <map>
24 #include <set>
25 #include <string>
26 
31 
32 namespace gtirb {
33 namespace schema {
34 
37  static constexpr const char* Name = "functionBlocks";
38  typedef std::map<gtirb::UUID, std::set<gtirb::UUID>> Type;
39 };
40 
43  static constexpr const char* Name = "functionEntries";
44  typedef std::map<gtirb::UUID, std::set<gtirb::UUID>> Type;
45 };
46 
48 struct FunctionNames {
49  static constexpr const char* Name = "functionNames";
50  typedef std::map<gtirb::UUID, gtirb::UUID> Type;
51 };
52 
54 struct Types {
55  static constexpr const char* Name = "types";
56  typedef std::map<gtirb::UUID, std::string> Type;
57 };
58 
60 struct Alignment {
61  static constexpr const char* Name = "alignment";
62  typedef std::map<gtirb::UUID, uint64_t> Type;
63 };
64 
66 struct Comments {
67  static constexpr const char* Name = "comments";
68  typedef std::map<gtirb::Offset, std::string> Type;
69 };
70 
73  static constexpr const char* Name = "symbolForwarding";
74  typedef std::map<gtirb::UUID, gtirb::UUID> Type;
75 };
76 
78 struct Padding {
79  static constexpr const char* Name = "padding";
80  typedef std::map<gtirb::Offset, uint64_t> Type;
81 };
82 
86  static constexpr const char* Name = "elfDynamicInit";
87  typedef gtirb::UUID Type;
88 };
89 
93  static constexpr const char* Name = "elfDynamicFini";
94  typedef gtirb::UUID Type;
95 };
96 
99 struct ElfSoname {
100  static constexpr const char* Name = "elfSoname";
101  typedef std::string Type;
102 };
103 
106 struct ElfStackExec {
107  static constexpr const char* Name = "elfStackExec";
108  typedef bool Type;
109 };
110 
113 struct ElfStackSize {
114  static constexpr const char* Name = "elfStackSize";
115  typedef uint64_t Type;
116 };
117 
118 } // namespace schema
119 
120 namespace provisional_schema {
121 
123 struct Profile {
124  static constexpr const char* Name = "profile";
125  typedef std::map<gtirb::Offset, uint64_t> Type;
126 };
127 
129 using SymbolVersionId = uint16_t;
137 using ElfSymVerDefs =
138  std::map<SymbolVersionId, std::tuple<std::vector<std::string>, uint16_t>>;
141 using ElfSymVerNeeded =
142  std::map<std::string, std::map<SymbolVersionId, std::string>>;
146  std::map<gtirb::UUID, std::tuple<SymbolVersionId, bool>>;
147 
152  static constexpr const char* Name = "elfSymbolVersions";
153  typedef std::tuple<ElfSymVerDefs, ElfSymVerNeeded, ElfSymbolVersionsEntries>
155 };
156 
157 } // namespace provisional_schema
158 } // namespace gtirb
159 
160 #endif // GTIRB_AUXDATASCHEMA_HPP
gtirb::schema::ElfStackExec::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:107
gtirb::schema::FunctionNames::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:49
gtirb::schema::ElfDynamicFini::Type
gtirb::UUID Type
Definition: AuxDataSchema.hpp:94
gtirb::schema::ElfStackSize::Type
uint64_t Type
Definition: AuxDataSchema.hpp:115
gtirb::schema::FunctionEntries::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:43
gtirb::schema::Comments::Type
std::map< gtirb::Offset, std::string > Type
Definition: AuxDataSchema.hpp:68
gtirb::UUID
boost::uuids::uuid UUID
Represents a universally unique identifier used to identify Node objects across serialization boundar...
Definition: Context.hpp:36
gtirb::schema::Comments
Schema class for comments auxiliary data.
Definition: AuxDataSchema.hpp:66
gtirb::schema::Alignment::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:61
gtirb::schema::ElfStackSize::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:114
gtirb::schema::Types
Schema class for types auxiliary data.
Definition: AuxDataSchema.hpp:54
gtirb::provisional_schema::SymbolVersionId
uint16_t SymbolVersionId
Version identifiers are 16 bit unsigned integers.
Definition: AuxDataSchema.hpp:129
gtirb::provisional_schema::Profile::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:124
Context.hpp
Class gtirb::Context and related operators.
gtirb::provisional_schema::Profile::Type
std::map< gtirb::Offset, uint64_t > Type
Definition: AuxDataSchema.hpp:125
gtirb::schema::ElfSoname
Schema class for ELF file's dynamic entry DT_SONAME. It contains a SONAME as string.
Definition: AuxDataSchema.hpp:99
gtirb::schema::Alignment
Schema class for alignment auxiliary data.
Definition: AuxDataSchema.hpp:60
gtirb::schema::Comments::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:67
gtirb::provisional_schema::ElfSymbolVersions::Type
std::tuple< ElfSymVerDefs, ElfSymVerNeeded, ElfSymbolVersionsEntries > Type
Definition: AuxDataSchema.hpp:154
gtirb
Main namespace for the GTIRB API.
Definition: Addr.hpp:28
gtirb::schema::Types::Type
std::map< gtirb::UUID, std::string > Type
Definition: AuxDataSchema.hpp:56
gtirb::schema::Padding::Type
std::map< gtirb::Offset, uint64_t > Type
Definition: AuxDataSchema.hpp:80
gtirb::schema::ElfDynamicFini
Schema class for ELF file's dynamic entry DT_FINI. It contains a CodeBlock's UUID.
Definition: AuxDataSchema.hpp:92
gtirb::schema::FunctionBlocks::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:37
gtirb::schema::FunctionEntries::Type
std::map< gtirb::UUID, std::set< gtirb::UUID > > Type
Definition: AuxDataSchema.hpp:44
Offset.hpp
gtirb::provisional_schema::Profile
Schema class for profile aux data.
Definition: AuxDataSchema.hpp:123
gtirb::schema::ElfDynamicFini::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:93
gtirb::schema::ElfSoname::Type
std::string Type
Definition: AuxDataSchema.hpp:101
gtirb::schema::FunctionBlocks::Type
std::map< gtirb::UUID, std::set< gtirb::UUID > > Type
Definition: AuxDataSchema.hpp:38
gtirb::schema::Padding::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:79
gtirb::schema::Alignment::Type
std::map< gtirb::UUID, uint64_t > Type
Definition: AuxDataSchema.hpp:62
gtirb::schema::ElfStackExec::Type
bool Type
Definition: AuxDataSchema.hpp:108
gtirb::provisional_schema::ElfSymbolVersions::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:152
gtirb::schema::FunctionNames
Schema class for functionNames auxiliary data.
Definition: AuxDataSchema.hpp:48
gtirb::schema::FunctionBlocks
Schema class for functionBlocks auxiliary data.
Definition: AuxDataSchema.hpp:36
gtirb::schema::ElfSoname::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:100
gtirb::schema::Types::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:55
gtirb::provisional_schema::ElfSymbolVersions
Auxiliary data for ELF symbol versions. This includes the symbol version definitions,...
Definition: AuxDataSchema.hpp:151
gtirb::schema::ElfStackExec
Schema class for stack executable flag specified by PT_GNU_STACK segment in ELF files.
Definition: AuxDataSchema.hpp:106
gtirb::schema::SymbolForwarding::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:73
gtirb::schema::ElfDynamicInit::Name
static constexpr const char * Name
Definition: AuxDataSchema.hpp:86
gtirb::schema::ElfDynamicInit::Type
gtirb::UUID Type
Definition: AuxDataSchema.hpp:87
gtirb::schema::FunctionNames::Type
std::map< gtirb::UUID, gtirb::UUID > Type
Definition: AuxDataSchema.hpp:50
gtirb::provisional_schema::ElfSymbolVersionsEntries
std::map< gtirb::UUID, std::tuple< SymbolVersionId, bool > > ElfSymbolVersionsEntries
Definition: AuxDataSchema.hpp:146
gtirb::provisional_schema::ElfSymVerDefs
std::map< SymbolVersionId, std::tuple< std::vector< std::string >, uint16_t > > ElfSymVerDefs
Definition: AuxDataSchema.hpp:138
gtirb::schema::ElfDynamicInit
Schema class for ELF file's dynamic entry DT_INIT. It contains a CodeBlock's UUID.
Definition: AuxDataSchema.hpp:85
gtirb::schema::SymbolForwarding
Schema class for symbolForwarding auxiliary data.
Definition: AuxDataSchema.hpp:72
gtirb::provisional_schema::ElfSymVerNeeded
std::map< std::string, std::map< SymbolVersionId, std::string > > ElfSymVerNeeded
Definition: AuxDataSchema.hpp:142
gtirb::schema::Padding
Schema class for padding auxiliary data.
Definition: AuxDataSchema.hpp:78
Addr.hpp
Class gtirb::Addr and related functions.
gtirb::schema::ElfStackSize
Schema class for the size of the PT_GNU_STACK segment in ELF files, which may influence the runtime s...
Definition: AuxDataSchema.hpp:113
gtirb::schema::SymbolForwarding::Type
std::map< gtirb::UUID, gtirb::UUID > Type
Definition: AuxDataSchema.hpp:74
gtirb::schema::FunctionEntries
Schema class for functionEntries auxiliary data.
Definition: AuxDataSchema.hpp:42