decompiler  1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::BreakTableCallBack Class Reference

A basic instantiation of a breakpoint table. More...

#include <emulate.hh>

Inheritance diagram for ghidra::BreakTableCallBack:
ghidra::BreakTable

Public Member Functions

 BreakTableCallBack (Translate *t)
 Basic breaktable constructor. More...
 
void registerPcodeCallback (const string &nm, BreakCallBack *func)
 Register a pcode based breakpoint. More...
 
void registerAddressCallback (const Address &addr, BreakCallBack *func)
 Register an address based breakpoint. More...
 
virtual void setEmulate (Emulate *emu)
 Associate an emulator with all breakpoints in the table. More...
 
virtual bool doPcodeOpBreak (PcodeOpRaw *curop)
 Invoke any breakpoints for the given pcode op. More...
 
virtual bool doAddressBreak (const Address &addr)
 Invoke any breakpoints for the given address. More...
 

Private Attributes

Emulateemulate
 The emulator associated with this table.
 
Translatetrans
 The translator.
 
map< Address, BreakCallBack * > addresscallback
 a container of pcode based breakpoints
 
map< uintb, BreakCallBack * > pcodecallback
 a container of addressed based breakpoints
 

Detailed Description

A basic instantiation of a breakpoint table.

This object allows breakpoints to registered in the table via either

Breakpoints are stored in map containers, and the core BreakTable methods are implemented to search in these containers

Constructor & Destructor Documentation

◆ BreakTableCallBack()

ghidra::BreakTableCallBack::BreakTableCallBack ( Translate t)
inline

Basic breaktable constructor.

The break table needs a translator object so user-defined pcode ops can be registered against by name.

Parameters
tis the translator object

Member Function Documentation

◆ doAddressBreak()

bool ghidra::BreakTableCallBack::doAddressBreak ( const Address addr)
virtual

Invoke any breakpoints for the given address.

This routine examines the address based container for any breakpoints associated with the given address. If one is found, its addressCallback method is invoked.

Parameters
addris the address being checked for breakpoints
Returns
true if the breakpoint exists and returns true, otherwise return false

Implements ghidra::BreakTable.

References addresscallback.

◆ doPcodeOpBreak()

bool ghidra::BreakTableCallBack::doPcodeOpBreak ( PcodeOpRaw curop)
virtual

Invoke any breakpoints for the given pcode op.

This routine examines the pcode-op based container for any breakpoints associated with the given op. If one is found, its pcodeCallback method is invoked.

Parameters
curopis pcode op being checked for breakpoints
Returns
true if the breakpoint exists and returns true, otherwise return false

Implements ghidra::BreakTable.

References ghidra::PcodeOpRaw::getInput(), ghidra::VarnodeData::offset, and pcodecallback.

◆ registerAddressCallback()

void ghidra::BreakTableCallBack::registerAddressCallback ( const Address addr,
BreakCallBack func 
)

Register an address based breakpoint.

Any time the emulator is about to execute (the pcode translation of) a particular machine instruction at this address, the indicated breakpoint is invoked first. The break table does not assume responsibility for freeing the breakpoint object.

Parameters
addris the address associated with the breakpoint
funcis the breakpoint being registered

References addresscallback, emulate, and ghidra::BreakCallBack::setEmulate().

◆ registerPcodeCallback()

void ghidra::BreakTableCallBack::registerPcodeCallback ( const string &  name,
BreakCallBack func 
)

Register a pcode based breakpoint.

Any time the emulator is about to execute a user-defined pcode op with the given name, the indicated breakpoint is invoked first. The break table does not assume responsibility for freeing the breakpoint object.

Parameters
nameis the name of the user-defined pcode op
funcis the breakpoint object to associate with the pcode op

References emulate, ghidra::Translate::getUserOpNames(), pcodecallback, ghidra::BreakCallBack::setEmulate(), and trans.

◆ setEmulate()

void ghidra::BreakTableCallBack::setEmulate ( Emulate emu)
virtual

Associate an emulator with all breakpoints in the table.

This routine invokes the setEmulate method on each breakpoint currently in the table

Parameters
emuis the emulator to be associated with the breakpoints

Implements ghidra::BreakTable.

References addresscallback, emulate, and pcodecallback.


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