ROSE 0.11.145.134
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo Class Reference

Description

Information about an instruction.

Definition at line 271 of file ParallelPartitioner.h.

#include <Rose/BinaryAnalysis/Partitioner2/ParallelPartitioner.h>

Inheritance diagram for Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo:
Collaboration graph
[legend]

Classes

struct  Cached
 Cached information. More...
 

Public Types

using Ptr = std::shared_ptr< InsnInfo >
 Shared ownership pointer.
 
using List = std::vector< Ptr >
 List of pointers to InsnInfo objects.
 

Public Member Functions

 InsnInfo (const InstructionPtr &insn)
 Construct info with decoded instruction.
 
 InsnInfo (rose_addr_t va)
 Construct info from only an address.
 
rose_addr_t address () const
 Address of instruction.
 
Sawyer::Optional< size_t > size () const
 Size of instruciton in bytes if known.
 
Sawyer::Optional< AddressIntervalhull () const
 Location of instruction if known.
 
InstructionPtr ast () const
 Get the underlying instruction AST.
 
FunctionReasons functionReasons () const
 Property: Function reasons.
 
void functionReasons (FunctionReasons)
 Property: Function reasons.
 
void insertFunctionReasons (FunctionReasons)
 Property: Function reasons.
 
void eraseFunctionReasons (FunctionReasons)
 Property: Function reasons.
 
const Cachedcached () const
 Cached information.
 
Cachedcached ()
 Cached information.
 
bool wasDecoded () const
 Whether any attempt was made to decode this instruction.
 
void setDecoded ()
 Whether any attempt was made to decode this instruction.
 

Static Public Member Functions

static bool addressOrder (const Ptr &a, const Ptr &b)
 For sorty by address.
 
static uint64_t hash (const List &)
 Hash instruction list.
 

Member Typedef Documentation

◆ Ptr

Shared ownership pointer.

Definition at line 273 of file ParallelPartitioner.h.

◆ List

List of pointers to InsnInfo objects.

Definition at line 274 of file ParallelPartitioner.h.

Constructor & Destructor Documentation

◆ InsnInfo() [1/2]

Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::InsnInfo ( const InstructionPtr insn)
inlineexplicit

Construct info with decoded instruction.

The insn must be non-null.

Definition at line 304 of file ParallelPartitioner.h.

◆ InsnInfo() [2/2]

Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::InsnInfo ( rose_addr_t  va)
inlineexplicit

Construct info from only an address.

Definition at line 311 of file ParallelPartitioner.h.

Member Function Documentation

◆ address()

rose_addr_t Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::address ( ) const
inline

Address of instruction.

The starting address of the instruction. This information is available for every object, even if we've never attempted to decode an instruction at that address and wasDecoded is returning false. The address is provided by the constructor and is read only.

Thread safety: This function is thread safe.

Definition at line 321 of file ParallelPartitioner.h.

◆ size()

Sawyer::Optional< size_t > Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::size ( ) const

Size of instruciton in bytes if known.

The size of an instruction is known only after wasDecoded is returning true; before that, this function returns nothing. After an instruction is decoded, its size is available regardless of whether the instruction AST is in memory or has been evicted.

Thread safety: This function is thread safe.

◆ hull()

Sawyer::Optional< AddressInterval > Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::hull ( ) const

Location of instruction if known.

The addresses occupied by this instruction. This is a combination of the starting address and instruction size and therefore is available only after wasDecoded is returning true. This information is available even when the instruction AST is evicted from the cache.

Thread safety: This function is thread safe.

◆ functionReasons() [1/2]

FunctionReasons Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::functionReasons ( ) const

Property: Function reasons.

This is a set of reason bits that describe why this instruction is the entry point of a function. If the set is empty then this instruction is not a function entry point.

Thread safety: This function is thread safe.

◆ functionReasons() [2/2]

void Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::functionReasons ( FunctionReasons  )

Property: Function reasons.

This is a set of reason bits that describe why this instruction is the entry point of a function. If the set is empty then this instruction is not a function entry point.

Thread safety: This function is thread safe.

◆ insertFunctionReasons()

void Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::insertFunctionReasons ( FunctionReasons  )

Property: Function reasons.

This is a set of reason bits that describe why this instruction is the entry point of a function. If the set is empty then this instruction is not a function entry point.

Thread safety: This function is thread safe.

◆ eraseFunctionReasons()

void Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::eraseFunctionReasons ( FunctionReasons  )

Property: Function reasons.

This is a set of reason bits that describe why this instruction is the entry point of a function. If the set is empty then this instruction is not a function entry point.

Thread safety: This function is thread safe.

◆ cached() [1/2]

const Cached & Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::cached ( ) const
inline

Cached information.

Returns informatio that's cached at a particular CFG vertex.

Thread safety: This function is thread safe.

Definition at line 364 of file ParallelPartitioner.h.

◆ cached() [2/2]

Cached & Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::cached ( )
inline

Cached information.

Returns informatio that's cached at a particular CFG vertex.

Thread safety: This function is thread safe.

Definition at line 365 of file ParallelPartitioner.h.

◆ wasDecoded()

bool Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::wasDecoded ( ) const

Whether any attempt was made to decode this instruction.

An InsnInfo object can exist without there having ever been any attempt to actually decode an instruction at the specified address. In this case, the ast will be a null pointer, but that's indistinguishable from the case when a decode was attempted and failed. Therefore, this flag will be set after the first decode is attempted.

Certain other properties of an instruction, such as its size, are only available after the instruction was decoded.

Once wasDecoded returns true it will always return true.

Thread safety: This function is thread safe.

◆ setDecoded()

void Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::setDecoded ( )

Whether any attempt was made to decode this instruction.

An InsnInfo object can exist without there having ever been any attempt to actually decode an instruction at the specified address. In this case, the ast will be a null pointer, but that's indistinguishable from the case when a decode was attempted and failed. Therefore, this flag will be set after the first decode is attempted.

Certain other properties of an instruction, such as its size, are only available after the instruction was decoded.

Once wasDecoded returns true it will always return true.

Thread safety: This function is thread safe.

◆ ast()

InstructionPtr Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::ast ( ) const

Get the underlying instruction AST.

Returns the underlying instruction. The wasDecoded flag must be set before calling this. Returns a null pointer if the memory is invalid (not mapped or not executable), or a non-null pointer (possibly an "unknown" instruction) otherwise.

Thread safety: This function is thread safe.

◆ addressOrder()

static bool Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::addressOrder ( const Ptr a,
const Ptr b 
)
static

For sorty by address.

Returns true if the address of a is less than the address of b.

Thread safety: This instruction is thread safe.

◆ hash()

static uint64_t Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::InsnInfo::hash ( const List )
static

Hash instruction list.

Hashes the specified list of instructions in order to get a value that can be used as a lookup key.

Thread safety: This function is thread safe.


The documentation for this class was generated from the following file: