GTIRB
v2.1.0
GrammaTech Intermediate Representation for Binaries: C++ API
|
Main namespace for the GTIRB API. More...
Namespaces | |
provisional_schema | |
schema | |
Classes | |
class | Addr |
A special class to store an Effective Address. More... | |
class | AddrRange |
A range of addresses. More... | |
struct | auxdata_traits |
Provides type information and serialization functions for types which can be stored in AuxData. More... | |
class | AuxDataContainer |
Contains the AuxData Tables and serves as a base class. More... | |
class | ByteInterval |
A contiguous region of bytes in a binary. More... | |
class | ByteIntervalObserver |
Interface for notifying observers when the ByteInterval is modified. More... | |
class | CfgNode |
Represents the base of types that can be inserted into the CFG. More... | |
class | CodeBlock |
A basic block. More... | |
class | CodeBlockObserver |
Interface for notifying observers when a CodeBlock is modified. More... | |
class | Context |
The context under which GTIRB operations occur. More... | |
class | DataBlock |
Represents a data object, possibly symbolic. More... | |
class | DataBlockObserver |
Interface for notifying observers when a DataBlock is modified. More... | |
struct | ErrorInfo |
class | ErrorOr |
class | IR |
A complete internal representation consisting of Modules (Module). More... | |
struct | is_mapping |
Trait class that identifies whether T is a mapping container type. More... | |
struct | is_sequence |
Trait class that identifies whether T is a sequential container type. More... | |
class | Module |
Represents a single binary (library or executable). More... | |
class | ModuleObserver |
Interface for notifying observers when the Module is updated. More... | |
class | Node |
Represents the base of the Node class hierarchy. More... | |
class | Offset |
Describes a location inside a node (byte interval, block, etc). More... | |
class | ProxyBlock |
A placeholder that serves as the endpoint (source or target) of a CFG edge. More... | |
class | Section |
Represents a named section of the binary. More... | |
class | SectionObserver |
Interface for notifying observers when the Section is modified. More... | |
struct | SymAddrAddr |
Represents a symbolic operand of the form "(Sym1 - Sym2) / Scale + Offset". More... | |
struct | SymAddrConst |
Represents a symbolic operand of the form "Sym + Offset". More... | |
class | Symbol |
Represents a Symbol, which maps a name to an object in the IR. More... | |
class | SymbolObserver |
Interface for notifying observers when the Symbol is updated. More... | |
Typedefs | |
using | block_iterator = cfg_node_cast_iter< CodeBlock > |
Iterator over blocks (Block). More... | |
using | CFG = CfgBuilder< boost::listS, boost::listS, boost::bidirectionalS >::type |
Interprocedural control flow graph, with vertices of type Block. More... | |
using | cfg_iterator = boost::indirect_iterator< cfg_node_iter_base > |
Iterator over CfgNodes (CfgNode). More... | |
using | cfg_predecessors_range = boost::iterator_range< boost::transform_iterator< EdgeDescrToNodeLabel< CfgPredecessorTraits, CfgNode * >, CfgPredecessorTraits::edge_iterator > > |
iterator_range over a CfgNode's predecessors, non-const version More... | |
using | cfg_successors_range = boost::iterator_range< boost::transform_iterator< EdgeDescrToNodeLabel< CfgSuccessorTraits, CfgNode * >, CfgSuccessorTraits::edge_iterator > > |
iterator_range over a CfgNode's successors, non-const version More... | |
using | const_block_iterator = cfg_node_cast_iter< const CodeBlock > |
Constant iterator over blocks (Block). More... | |
using | const_cfg_iterator = boost::indirect_iterator< cfg_node_iter_base, const CfgNode > |
Const iterator over CfgNodes (CfgNode). More... | |
using | const_cfg_predecessors_range = boost::iterator_range< boost::transform_iterator< EdgeDescrToNodeLabel< CfgPredecessorTraits, const CfgNode * >, CfgPredecessorTraits::edge_iterator > > |
iterator_range over a CfgNode's predecessors, const version More... | |
using | const_cfg_successors_range = boost::iterator_range< boost::transform_iterator< EdgeDescrToNodeLabel< CfgSuccessorTraits, const CfgNode * >, CfgSuccessorTraits::edge_iterator > > |
iterator_range over a CfgNode's successors, const version More... | |
using | EdgeLabel = std::optional< std::tuple< ConditionalEdge, DirectEdge, EdgeType > > |
A label on a CFG edge. More... | |
using | SymAttributeSet = std::set< SymAttribute > |
using | SymbolicExpression = std::variant< SymAddrConst, SymAddrAddr > |
A symbolic expression. More... | |
using | UUID = boost::uuids::uuid |
Represents a universally unique identifier used to identify Node objects across serialization boundaries. More... | |
Enumerations | |
enum | ByteOrder : uint8_t { ByteOrder::Undefined = proto::ByteOrder_Undefined, ByteOrder::Big = proto::BigEndian, ByteOrder::Little = proto::LittleEndian } |
enum | ChangeStatus { ChangeStatus::Rejected, ChangeStatus::Accepted, ChangeStatus::NoChange } |
enum | ConditionalEdge : bool { ConditionalEdge::OnFalse, ConditionalEdge::OnTrue } |
Indicates whether an edge is conditional on true. More... | |
enum | DecodeMode : uint8_t { DecodeMode::Default = proto::All_Default, DecodeMode::Thumb = proto::ARM_Thumb } |
Variations on decoding a particular ISA. More... | |
enum | DirectEdge : bool { DirectEdge::IsIndirect, DirectEdge::IsDirect } |
Indicates whether an edge represents indirect control flow. More... | |
enum | EdgeType { EdgeType::Branch, EdgeType::Call, EdgeType::Fallthrough, EdgeType::Return, EdgeType::Syscall, EdgeType::Sysret } |
Indicates the type of control flow transfer indicated by this edge. More... | |
enum | FileFormat : uint8_t { FileFormat::Undefined = proto::Format_Undefined, FileFormat::COFF = proto::COFF, FileFormat::ELF = proto::ELF, FileFormat::PE = proto::PE, FileFormat::IdaProDb32 = proto::IdaProDb32, FileFormat::IdaProDb64 = proto::IdaProDb64, FileFormat::XCOFF = proto::XCOFF, FileFormat::MACHO = proto::MACHO, FileFormat::RAW = proto::RAW } |
Identifies an exectuable file format. More... | |
enum | ISA : uint8_t { ISA::Undefined = proto::ISA_Undefined, ISA::IA32 = proto::IA32, ISA::PPC32 = proto::PPC32, ISA::X64 = proto::X64, ISA::ARM = proto::ARM, ISA::ValidButUnsupported = proto::ValidButUnsupported, ISA::PPC64 = proto::PPC64, ISA::ARM64 = proto::ARM64, ISA::MIPS32 = proto::MIPS32, ISA::MIPS64 = proto::MIPS64 } |
enum | SectionFlag : uint8_t { SectionFlag::Undefined = proto::SectionFlag::Section_Undefined, SectionFlag::Readable = proto::SectionFlag::Readable, SectionFlag::Writable = proto::SectionFlag::Writable, SectionFlag::Executable = proto::SectionFlag::Executable, SectionFlag::Loaded = proto::SectionFlag::Loaded, SectionFlag::Initialized = proto::SectionFlag::Initialized, SectionFlag::ThreadLocal = proto::SectionFlag::ThreadLocal } |
Idenfities the flags used for a section. More... | |
enum | SymAttribute : uint16_t { SymAttribute::GOT = proto::SymAttribute::GOT, SymAttribute::GOTPC = proto::SymAttribute::GOTPC, SymAttribute::GOTOFF = proto::SymAttribute::GOTOFF, SymAttribute::GOTREL = proto::SymAttribute::GOTREL, SymAttribute::PLT = proto::SymAttribute::PLT, SymAttribute::PLTOFF = proto::SymAttribute::PLTOFF, SymAttribute::PCREL = proto::SymAttribute::PCREL, SymAttribute::SECREL = proto::SymAttribute::SECREL, SymAttribute::TLS = proto::SymAttribute::TLS, SymAttribute::TLSGD = proto::SymAttribute::TLSGD, SymAttribute::TLSLD = proto::SymAttribute::TLSLD, SymAttribute::TLSLDM = proto::SymAttribute::TLSLDM, SymAttribute::TLSCALL = proto::SymAttribute::TLSCALL, SymAttribute::TLSDESC = proto::SymAttribute::TLSDESC, SymAttribute::TPREL = proto::SymAttribute::TPREL, SymAttribute::TPOFF = proto::SymAttribute::TPOFF, SymAttribute::DTPREL = proto::SymAttribute::DTPREL, SymAttribute::DTPOFF = proto::SymAttribute::DTPOFF, SymAttribute::DTPMOD = proto::SymAttribute::DTPMOD, SymAttribute::NTPOFF = proto::SymAttribute::NTPOFF, SymAttribute::PAGE = proto::SymAttribute::PAGE, SymAttribute::PAGEOFF = proto::SymAttribute::PAGEOFF, SymAttribute::CALL = proto::SymAttribute::CALL, SymAttribute::LO = proto::SymAttribute::LO, SymAttribute::HI = proto::SymAttribute::HI, SymAttribute::HIGHER = proto::SymAttribute::HIGHER, SymAttribute::HIGHEST = proto::SymAttribute::HIGHEST, SymAttribute::GOTNTPOFF = proto::SymAttribute::GOTNTPOFF, SymAttribute::INDNTPOFF = proto::SymAttribute::INDNTPOFF, SymAttribute::G0 = proto::SymAttribute::G0, SymAttribute::G1 = proto::SymAttribute::G1, SymAttribute::G2 = proto::SymAttribute::G2, SymAttribute::G3 = proto::SymAttribute::G3, SymAttribute::UPPER16 = proto::SymAttribute::UPPER16, SymAttribute::LOWER16 = proto::SymAttribute::LOWER16, SymAttribute::LO12 = proto::SymAttribute::LO12, SymAttribute::LO15 = proto::SymAttribute::LO15, SymAttribute::LO14 = proto::SymAttribute::LO14, SymAttribute::HI12 = proto::SymAttribute::HI12, SymAttribute::HI21 = proto::SymAttribute::HI21, SymAttribute::S = proto::SymAttribute::S, SymAttribute::PG = proto::SymAttribute::PG, SymAttribute::NC = proto::SymAttribute::NC, SymAttribute::ABS = proto::SymAttribute::ABS, SymAttribute::PREL = proto::SymAttribute::PREL, SymAttribute::PREL31 = proto::SymAttribute::PREL31, SymAttribute::TARGET1 = proto::SymAttribute::TARGET1, SymAttribute::TARGET2 = proto::SymAttribute::TARGET2, SymAttribute::SBREL = proto::SymAttribute::SBREL, SymAttribute::TLSLDO = proto::SymAttribute::TLSLDO, SymAttribute::HI16 = proto::SymAttribute::HI16, SymAttribute::LO16 = proto::SymAttribute::LO16, SymAttribute::GPREL = proto::SymAttribute::GPREL, SymAttribute::DISP = proto::SymAttribute::DISP, SymAttribute::OFST = proto::SymAttribute::OFST, SymAttribute::H = proto::SymAttribute::H, SymAttribute::L = proto::SymAttribute::L, SymAttribute::HA = proto::SymAttribute::HA, SymAttribute::HIGH = proto::SymAttribute::HIGH, SymAttribute::HIGHA = proto::SymAttribute::HIGHA, SymAttribute::HIGHERA = proto::SymAttribute::HIGHERA, SymAttribute::HIGHESTA = proto::SymAttribute::HIGHESTA, SymAttribute::TOCBASE = proto::SymAttribute::TOCBASE, SymAttribute::TOC = proto::SymAttribute::TOC, SymAttribute::NOTOC = proto::SymAttribute::NOTOC } |
The space of attributes that can be applied to a symbolic expression. More... | |
Functions | |
GTIRB_EXPORT_API std::optional< CFG::edge_descriptor > | addEdge (const CfgNode *From, const CfgNode *To, CFG &Cfg) |
Create a new edge between two CFG nodes if they exist in the graph. More... | |
GTIRB_EXPORT_API std::pair< CFG::vertex_descriptor, bool > | addVertex (CfgNode *B, CFG &Cfg) |
Add a node to the CFG. More... | |
template<> | |
std::optional< uint64_t > | asOptionalSize (std::optional< uint64_t > X) |
template<typename T > | |
std::optional< uint64_t > | asOptionalSize (T X) |
template<> | |
std::optional< uint64_t > | asOptionalSize (uint64_t X) |
gtirb::AuxDataContainer Node | AuxDataContainer (Context &C, Kind knd) |
AuxDataContainer (Context &C, Kind knd, const UUID &U) | |
GTIRB_EXPORT_API boost::iterator_range< block_iterator > | blocks (CFG &Cfg) |
Get a range of just the Block elements in the specified graph. More... | |
GTIRB_EXPORT_API boost::iterator_range< const_block_iterator > | blocks (const CFG &Cfg) |
Get a constant range of just the Block elements in the specified graph. More... | |
cfg_predecessors_range | cfgPredecessors (CFG &G, const CfgNode *N) |
Returns an iterator_range to iterate the predecessors of a CfgNode. More... | |
const_cfg_predecessors_range | cfgPredecessors (const CFG &G, const CfgNode *N) |
cfg_successors_range | cfgSuccessors (CFG &G, const CfgNode *N) |
Returns an iterator_range to iterate the successors of a CfgNode. More... | |
const_cfg_successors_range | cfgSuccessors (const CFG &G, const CfgNode *N) |
GTIRB_EXPORT_API std::optional< CFG::vertex_descriptor > | getVertex (const CfgNode *N, const CFG &Cfg) |
Get the boost::graph vertex descriptor for a CfgNode if it is in the graph. More... | |
const GTIRB_EXPORT_API std::error_category & | loadErrorCategory () |
The error category used to represent load failures. More... | |
std::error_code | make_error_code (gtirb::IR::load_error e) |
Makes an std::error_code object from an IR::load_error object. More... | |
GTIRB_EXPORT_API boost::iterator_range< cfg_iterator > | nodes (CFG &Cfg) |
Get a range of the CfgNode elements in the specified graph. More... | |
GTIRB_EXPORT_API boost::iterator_range< const_cfg_iterator > | nodes (const CFG &Cfg) |
Get a constant range of the CfgNode elements in the specified graph. More... | |
template<typename CharT , typename Traits > | |
std::ostream & | operator<< (std::basic_ostream< CharT, Traits > &os, const ErrorInfo &Info) |
GTIRB_EXPORT_API std::ostream & | operator<< (std::ostream &OS, const ConditionalEdge &CE) |
GTIRB_EXPORT_API std::ostream & | operator<< (std::ostream &OS, const DirectEdge &DE) |
GTIRB_EXPORT_API std::ostream & | operator<< (std::ostream &OS, const EdgeLabel &Label) |
GTIRB_EXPORT_API std::ostream & | operator<< (std::ostream &OS, const EdgeType &ET) |
template<class T , class E > | |
std::enable_if_t< std::is_error_code_enum< E >::value||std::is_error_condition_enum< E >::value, bool > | operator== (const ErrorOr< T > &Err, E Code) |
GTIRB_EXPORT_API bool | removeEdge (const CfgNode *From, const CfgNode *To, CFG &Cfg) |
Remove all edges between the source and target nodes from the CFG. More... | |
GTIRB_EXPORT_API bool | removeEdge (const CfgNode *From, const CfgNode *To, EdgeLabel Label, CFG &Cfg) |
Remove all edges with given label between the source and target nodes from the CFG. More... | |
GTIRB_EXPORT_API bool | removeVertex (CfgNode *N, CFG &Cfg) |
Remove a node from the CFG. More... | |
Main namespace for the GTIRB API.
using gtirb::cfg_predecessors_range = typedef boost::iterator_range<boost::transform_iterator< EdgeDescrToNodeLabel<CfgPredecessorTraits, CfgNode*>, CfgPredecessorTraits::edge_iterator> > |
iterator_range over a CfgNode's predecessors, non-const version
using gtirb::cfg_successors_range = typedef boost::iterator_range<boost::transform_iterator< EdgeDescrToNodeLabel<CfgSuccessorTraits, CfgNode*>, CfgSuccessorTraits::edge_iterator> > |
iterator_range over a CfgNode's successors, non-const version
using gtirb::const_cfg_predecessors_range = typedef boost::iterator_range<boost::transform_iterator< EdgeDescrToNodeLabel<CfgPredecessorTraits, const CfgNode*>, CfgPredecessorTraits::edge_iterator> > |
iterator_range over a CfgNode's predecessors, const version
using gtirb::const_cfg_successors_range = typedef boost::iterator_range<boost::transform_iterator< EdgeDescrToNodeLabel<CfgSuccessorTraits, const CfgNode*>, CfgSuccessorTraits::edge_iterator> > |
iterator_range over a CfgNode's successors, const version
using gtirb::UUID = typedef boost::uuids::uuid |
|
strong |
|
strong |
|
strong |
|
strong |
Identifies an exectuable file format.
|
strong |
|
strong |
|
inline |
std::optional<uint64_t> gtirb::asOptionalSize | ( | T | X | ) |
|
inline |
gtirb::AuxDataContainer Node gtirb::AuxDataContainer | ( | Context & | C, |
Kind | knd | ||
) |
gtirb::AuxDataContainer | ( | Context & | C, |
Kind | knd, | ||
const UUID & | U | ||
) |
|
inline |
|
inline |
const GTIRB_EXPORT_API std::error_category& gtirb::loadErrorCategory | ( | ) |
The error category used to represent load failures.
|
inline |
Makes an std::error_code object from an IR::load_error object.
std::ostream& gtirb::operator<< | ( | std::basic_ostream< CharT, Traits > & | os, |
const ErrorInfo & | Info | ||
) |
GTIRB_EXPORT_API std::ostream& gtirb::operator<< | ( | std::ostream & | OS, |
const ConditionalEdge & | CE | ||
) |
GTIRB_EXPORT_API std::ostream& gtirb::operator<< | ( | std::ostream & | OS, |
const DirectEdge & | DE | ||
) |
GTIRB_EXPORT_API std::ostream& gtirb::operator<< | ( | std::ostream & | OS, |
const EdgeLabel & | Label | ||
) |
GTIRB_EXPORT_API std::ostream& gtirb::operator<< | ( | std::ostream & | OS, |
const EdgeType & | ET | ||
) |
std::enable_if_t<std::is_error_code_enum<E>::value || std::is_error_condition_enum<E>::value, bool> gtirb::operator== | ( | const ErrorOr< T > & | Err, |
E | Code | ||
) |