Package ghidra.pcode.emu.jit

# Record Class JitPassage.ErrBranch

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.JitPassage.ErrBranch

Record Components:
  `from` - see `from()`
  `message` - the error message for the exception

All Implemented Interfaces:
  `JitPassage.Branch`, `JitPassage.PBranch`, `JitPassage.SBranch`

Enclosing class:
  `JitPassage`

public static record JitPassage.ErrBranch(PcodeOp from, String message) extends Record implements JitPassage.SBranch, JitPassage.PBranch
A "branch" representing an error

When execution encounters this branch, the `run` method throws an exception. This branch is used to encode error conditions that may not actually be encountered at run time. Some cases are:

- An instruction decode error — synthesized as a `JitPassage.DecodeErrorPcodeOp`
- An `unimplemented` instruction
- A `call` to an undefined userop

The decoder and translator may encounter such an error, but unless execution actually reaches the error, the emulator need not crash. Thus, we note the error and generate code that will actually throw it in the translation, only if it's actually encountered.

Note that the `OpGen` for the specific p-code op generating the error will decide what exception type to throw.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ErrBranch(PcodeOp from, String message)`
  Creates an instance of a `ErrBranch` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `PcodeOp`
  `from()`
  Returns the value of the `from` record component.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `String`
  `message()`
  Returns the value of the `message` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface ghidra.pcode.emu.jit.JitPassage.Branch

  `describeTo, isFall`

- ## Constructor Details

  - ### ErrBranch

    public ErrBranch(PcodeOp from, String message)
    Creates an instance of a `ErrBranch` record class.
    Parameters:
      `from` - the value for the `from` record component
      `message` - the value for the `message` record component

- ## Method Details

  - ### toString

    public final String toString()
    Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
    Specified by:
      `toString` in class `Record`
    Returns:
      a string representation of this object

  - ### hashCode

    public final int hashCode()
    Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
    Specified by:
      `hashCode` in class `Record`
    Returns:
      a hash code value for this object

  - ### equals

    public final boolean equals(Object o)
    Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.
    Specified by:
      `equals` in class `Record`
    Parameters:
      `o` - the object with which to compare
    Returns:
      `true` if this object is the same as the `o` argument; `false` otherwise.

  - ### from

    public PcodeOp from()
    Returns the value of the `from` record component.
    Specified by:
      `from` in interface `JitPassage.Branch`
    Returns:
      the value of the `from` record component

  - ### message

    public String message()
    Returns the value of the `message` record component.
    Returns:
      the value of the `message` record component