Class BreakTableCallBack

java.lang.Object
ghidra.pcode.emulate.BreakTableCallBack
All Implemented Interfaces:
BreakTable

public class BreakTableCallBack extends Object implements BreakTable
A basic instantiation of a breakpoint table

This object allows breakpoints to registered in the table via either

  • registerPcodeCallback()
  • registerAddressCallback()
Breakpoints are stored in map containers, and the core BreakTable methods are implemented to search in these containers
  • Field Details

  • Constructor Details

    • BreakTableCallBack

      public BreakTableCallBack(SleighLanguage language)
      The break table needs a translator object so user-defined pcode ops can be registered against by name.
      Parameters:
      language - the language
  • Method Details

    • registerPcodeCallback

      public void registerPcodeCallback(String name, BreakCallBack func)
      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:
      name - is the name of the user-defined pcode op
      func - is the breakpoint object to associate with the pcode op
    • unregisterPcodeCallback

      public void unregisterPcodeCallback(String name)
      Unregister the currently registered PcodeCallback handler for the specified name
      Parameters:
      name - is the name of the user-defined pcode op
    • registerAddressCallback

      public void registerAddressCallback(Address addr, BreakCallBack func)
      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:
      addr - is the address associated with the breakpoint
      func - is the breakpoint being registered
    • unregisterAddressCallback

      public void unregisterAddressCallback(Address addr)
    • setEmulate

      public void setEmulate(Emulate emu)
      This routine invokes the setEmulate method on each breakpoint currently in the table
      Specified by:
      setEmulate in interface BreakTable
      Parameters:
      emu - is the emulator to be associated with the breakpoints
    • doPcodeOpBreak

      public boolean doPcodeOpBreak(PcodeOpRaw curop)
      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.
      Specified by:
      doPcodeOpBreak in interface BreakTable
      Parameters:
      curop - is pcode op being checked for breakpoints
      Returns:
      true if the breakpoint exists and returns true, otherwise return false
    • doAddressBreak

      public boolean doAddressBreak(Address addr)
      This routine examines the address based container for any breakpoints associated with the given address. If one is found, its addressCallback method is invoked.
      Specified by:
      doAddressBreak in interface BreakTable
      Parameters:
      addr - is the address being checked for breakpoints
      Returns:
      true if the breakpoint exists and returns true, otherwise return false