ROSE  0.9.12.28
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 20 of file BinaryHotPatch.h.

#include <BinaryHotPatch.h>

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 InstructionSemantics2::BaseSemantics::RiscOperatorsPtr &) const
 Apply records to a machine state. More...
 
size_t operator() (const InstructionSemantics2::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 142 of file BinaryHotPatch.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 164 of file BinaryHotPatch.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 167 of file BinaryHotPatch.h.

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

Number of hot-patch records in this object.

Definition at line 173 of file BinaryHotPatch.h.

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

Remove all records from this object.

Definition at line 178 of file BinaryHotPatch.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 186 of file BinaryHotPatch.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 196 of file BinaryHotPatch.h.

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

Reference a particular record.

The idx must be less than nRecords.

Definition at line 200 of file BinaryHotPatch.h.

size_t Rose::BinaryAnalysis::HotPatch::apply ( const InstructionSemantics2::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 InstructionSemantics2::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 216 of file BinaryHotPatch.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 23 of file BinaryHotPatch.h.


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