Package ghidra.app.plugin.assembler.sleigh.sem

# Class DefaultAssemblyResolvedBackfill

java.lang.Object
ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyResolution
ghidra.app.plugin.assembler.sleigh.sem.DefaultAssemblyResolvedBackfill

All Implemented Interfaces:
  `AssemblyResolution`, `AssemblyResolvedBackfill`, `Comparable<AssemblyResolution>`

public class DefaultAssemblyResolvedBackfill extends AbstractAssemblyResolution implements AssemblyResolvedBackfill
A `AssemblyResolution` indicating the need to solve an expression in the future

Such records are collected within a `AssemblyResolvedPatterns` and then solved just before the final result(s) are assembled. This is typically required by instructions that refer to the `inst_next` symbol.

NOTE: These are used internally. The user ought never to see these from the assembly API.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final PatternExpression`
  `exp`
  `protected final MaskedLong`
  `goal`
  `protected final int`
  `inslen`
  `protected final int`
  `offset`

  ### Fields inherited from class ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyResolution

  `children, description, factory, right`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `DefaultAssemblyResolvedBackfill(AbstractAssemblyResolutionFactory<?,?> factory, String description, PatternExpression exp, MaskedLong goal, int inslen, int offset)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected int`
  `computeHash()`
  `protected AssemblyResolvedBackfill`
  `copy()`
  Duplicate this record
  `protected AbstractAssemblyResolutionFactory.AbstractAssemblyResolvedBackfillBuilder<?>`
  `copyBuilder()`
  `int`
  `getInstructionLength()`
  Get the expected length of the instruction portion of the future encoding This is used to make sure that operands following a to-be-determined encoding are placed properly.
  `boolean`
  `isBackfill()`
  Check if this record describes a backfill
  `boolean`
  `isError()`
  Check if this record describes an error
  `String`
  `lineToString()`
  Display the resolution result in one line (omitting child details)
  `AssemblyResolution`
  `parent(String description, int opCount)`
  Get this same resolution, pushing its right siblings down to its children
  `AssemblyResolvedBackfill`
  `shift(int amt)`
  Shift the resolution's instruction pattern to the right, if applicable
  `protected AbstractAssemblyResolutionFactory.AbstractAssemblyResolvedBackfillBuilder<?>`
  `shiftBuilder(int amt)`
  `AssemblyResolution`
  `solve(RecursiveDescentSolver solver, Map<String,Long> vals, AssemblyResolvedPatterns cur)`
  Attempt (again) to solve the expression that generated this backfill record
  `AssemblyResolvedBackfill`
  `withRight(AssemblyResolution right)`
  Get this same resolution, but with the given right sibling

  ### Methods inherited from class ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyResolution

  `childrenToString, collectAllRight, compareTo, getAllRight, getChildren, getDescription, getRight, hasChildren, hashCode, toString, toString, withoutRight`

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

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

  ### Methods inherited from interface ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution

  `collectAllRight, getChildren, getDescription, getRight, hasChildren, toString, toString`

  ### Methods inherited from interface java.lang.Comparable

  `compareTo`

- ## Field Details

  - ### exp

    protected final PatternExpression exp

  - ### goal

    protected final MaskedLong goal

  - ### inslen

    protected final int inslen

  - ### offset

    protected final int offset

- ## Constructor Details

  - ### DefaultAssemblyResolvedBackfill

    protected DefaultAssemblyResolvedBackfill(AbstractAssemblyResolutionFactory<?,?> factory, String description, PatternExpression exp, MaskedLong goal, int inslen, int offset)

- ## Method Details

  - ### computeHash

    protected int computeHash()
    Specified by:
      `computeHash` in class `AbstractAssemblyResolution`

  - ### copyBuilder

    protected AbstractAssemblyResolutionFactory.AbstractAssemblyResolvedBackfillBuilder<?> copyBuilder()

  - ### copy

    protected AssemblyResolvedBackfill copy()
    Duplicate this record
    Returns:
      the duplicate

  - ### withRight

    public AssemblyResolvedBackfill withRight(AssemblyResolution right)
    Description copied from class: `AbstractAssemblyResolution`
    Get this same resolution, but with the given right sibling
    Specified by:
      `withRight` in class `AbstractAssemblyResolution`
    Parameters:
      `right` - the right sibling
    Returns:
      the resolution

  - ### getInstructionLength

    public int getInstructionLength()
    Description copied from interface: `AssemblyResolvedBackfill`
    Get the expected length of the instruction portion of the future encoding This is used to make sure that operands following a to-be-determined encoding are placed properly. Even though the actual encoding cannot yet be determined, its length can.
    Specified by:
      `getInstructionLength` in interface `AssemblyResolvedBackfill`
    Returns:
      the total expected length (including the offset)

  - ### isError

    public boolean isError()
    Description copied from interface: `AssemblyResolution`
    Check if this record describes an error
    Specified by:
      `isError` in interface `AssemblyResolution`
    Returns:
      true if the record is an error

  - ### isBackfill

    public boolean isBackfill()
    Description copied from interface: `AssemblyResolution`
    Check if this record describes a backfill
    Specified by:
      `isBackfill` in interface `AssemblyResolution`
    Returns:
      true if the record is a backfill

  - ### lineToString

    public String lineToString()
    Description copied from interface: `AssemblyResolution`
    Display the resolution result in one line (omitting child details)
    Specified by:
      `lineToString` in interface `AssemblyResolution`
    Returns:
      the display description

  - ### shiftBuilder

    protected AbstractAssemblyResolutionFactory.AbstractAssemblyResolvedBackfillBuilder<?> shiftBuilder(int amt)

  - ### shift

    public AssemblyResolvedBackfill shift(int amt)
    Description copied from interface: `AssemblyResolution`
    Shift the resolution's instruction pattern to the right, if applicable

    This also shifts any backfill and forbidden pattern records.

    Specified by:
      `shift` in interface `AssemblyResolution`
    Specified by:
      `shift` in interface `AssemblyResolvedBackfill`
    Specified by:
      `shift` in class `AbstractAssemblyResolution`
    Parameters:
      `amt` - the number of bytes to shift.
    Returns:
      the result

  - ### parent

    public AssemblyResolution parent(String description, int opCount)
    Description copied from interface: `AssemblyResolution`
    Get this same resolution, pushing its right siblings down to its children
    Specified by:
      `parent` in interface `AssemblyResolution`

  - ### solve

    public AssemblyResolution solve(RecursiveDescentSolver solver, Map<String,Long> vals, AssemblyResolvedPatterns cur)
    Description copied from interface: `AssemblyResolvedBackfill`
    Attempt (again) to solve the expression that generated this backfill record

    This will attempt to solve the same expression and goal again, using the same parameters as were given to the original attempt, except with additional defined symbols. Typically, the symbol that required backfill is `inst_next`. This method will not throw `NeedsBackfillException`, since that would imply the missing symbol(s) from the original attempt are still missing. Instead, the method returns an instance of `AssemblyResolvedError`.

    Specified by:
      `solve` in interface `AssemblyResolvedBackfill`
    Parameters:
      `solver` - a solver, usually the same as the one from the original attempt.
      `vals` - the defined symbols, usually the same, but with the missing symbol(s).
    Returns:
      the solution result