Package ghidra.pcode.emulate

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DEFAULT_NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BreakTableCallBack(SleighLanguage language)`
  The break table needs a translator object so user-defined pcode ops can be registered against by name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `doAddressBreak(Address addr)`
  This routine examines the address based container for any breakpoints associated with the given address.
  `boolean`
  `doPcodeOpBreak(PcodeOpRaw curop)`
  This routine examines the pcode-op based container for any breakpoints associated with the given op.
  `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.
  `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.
  `void`
  `setEmulate(Emulate emu)`
  This routine invokes the setEmulate method on each breakpoint currently in the table
  `void`
  `unregisterAddressCallback(Address addr)`
  `void`
  `unregisterPcodeCallback(String name)`
  Unregister the currently registered PcodeCallback handler for the specified name

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_NAME

    public static final String DEFAULT_NAME
    See Also:
      - Constant Field Values

- ## 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