ROSE  0.11.145.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Rose::BinaryAnalysis::HotPatch Class Reference

Description

Describes how to modify machine state after each instruction.

The hot patching works by examining the hot patch records one by one trying to match them to the current machine state. When a record matches, the machine state is updated according to the matched record.

Definition at line 22 of file HotPatch.h.

#include <Rose/BinaryAnalysis/HotPatch.h>

Collaboration diagram for Rose::BinaryAnalysis::HotPatch:
Collaboration graph
[legend]

Classes

class  Record
 Describes a single hot patch. More...
 

Public Types

typedef std::vector< RecordRecords
 Ordered list of hot patch records. More...
 

Public Member Functions

size_t nRecords () const
 Number of hot-patch records in this object. More...
 
void clear ()
 Remove all records from this object. More...
 
size_t append (const Record &record)
 Append a hot-patch record. More...
 
const Recordsrecords () const
 Property: Hot patch records. More...
 
Recordsrecords ()
 Property: Hot patch records. More...
 
const Recordoperator[] (size_t idx) const
 Reference a particular record. More...
 
Recordoperator[] (size_t idx)
 Reference a particular record. More...
 
size_t apply (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &) const
 Apply records to a machine state. More...
 
size_t operator() (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops) const
 Apply records to a machine state. More...
 

Static Public Member Functions

static void initDiagnostics ()
 Initialize diagnostic output. More...
 

Static Public Attributes

static Sawyer::Message::Facility mlog
 Diagnostic output for hot patching. More...
 

Member Typedef Documentation

Ordered list of hot patch records.

Definition at line 144 of file HotPatch.h.

Member Function Documentation

const Records& Rose::BinaryAnalysis::HotPatch::records ( ) const
inline

Property: Hot patch records.

Hot patch records are matched in the order they're defined here.

Definition at line 166 of file HotPatch.h.

Records& Rose::BinaryAnalysis::HotPatch::records ( )
inline

Property: Hot patch records.

Hot patch records are matched in the order they're defined here.

Definition at line 169 of file HotPatch.h.

size_t Rose::BinaryAnalysis::HotPatch::nRecords ( ) const
inline

Number of hot-patch records in this object.

Definition at line 175 of file HotPatch.h.

void Rose::BinaryAnalysis::HotPatch::clear ( )
inline

Remove all records from this object.

Definition at line 180 of file HotPatch.h.

size_t Rose::BinaryAnalysis::HotPatch::append ( const Record record)
inline

Append a hot-patch record.

This is just a convenience function that's equivalent to records.push_back(x). It returns the index of the new record.

Definition at line 188 of file HotPatch.h.

const Record& Rose::BinaryAnalysis::HotPatch::operator[] ( size_t  idx) const
inline

Reference a particular record.

The idx must be less than nRecords.

Definition at line 198 of file HotPatch.h.

Record& Rose::BinaryAnalysis::HotPatch::operator[] ( size_t  idx)
inline

Reference a particular record.

The idx must be less than nRecords.

Definition at line 202 of file HotPatch.h.

size_t Rose::BinaryAnalysis::HotPatch::apply ( const InstructionSemantics::BaseSemantics::RiscOperatorsPtr ) const

Apply records to a machine state.

Scans through the records of this object and tries to match each against the specified machine state. If a match occurs, the state is modified according to the record. After a match is found and a change is made, the process continues according to the matched record's behavior property.

Returns the number of matching records that were applied.

Referenced by operator()().

size_t Rose::BinaryAnalysis::HotPatch::operator() ( const InstructionSemantics::BaseSemantics::RiscOperatorsPtr ops) const
inline

Apply records to a machine state.

Scans through the records of this object and tries to match each against the specified machine state. If a match occurs, the state is modified according to the record. After a match is found and a change is made, the process continues according to the matched record's behavior property.

Returns the number of matching records that were applied.

Definition at line 218 of file HotPatch.h.

References apply().

static void Rose::BinaryAnalysis::HotPatch::initDiagnostics ( )
static

Initialize diagnostic output.

This is called automatically when ROSE is initialized.

Member Data Documentation

Sawyer::Message::Facility Rose::BinaryAnalysis::HotPatch::mlog
static

Diagnostic output for hot patching.

Definition at line 25 of file HotPatch.h.


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