ROSE 0.11.145.192
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.
 

Public Member Functions

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

Static Public Member Functions

static void initDiagnostics ()
 Initialize diagnostic output.
 

Static Public Attributes

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

Member Typedef Documentation

◆ Records

Ordered list of hot patch records.

Definition at line 144 of file HotPatch.h.

Member Function Documentation

◆ records() [1/2]

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() [2/2]

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.

◆ nRecords()

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

Number of hot-patch records in this object.

Definition at line 175 of file HotPatch.h.

◆ clear()

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

Remove all records from this object.

Definition at line 180 of file HotPatch.h.

◆ append()

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.

◆ operator[]() [1/2]

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.

◆ operator[]() [2/2]

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.

◆ apply()

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()().

◆ 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().

◆ initDiagnostics()

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

Initialize diagnostic output.

This is called automatically when ROSE is initialized.

Member Data Documentation

◆ mlog

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: