Class AssemblyResolvedBackfill

java.lang.Object
ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolvedBackfill
All Implemented Interfaces:
Comparable<AssemblyResolution>

public class AssemblyResolvedBackfill extends AssemblyResolution
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 Details

    • exp

      protected final PatternExpression exp
    • goal

      protected final MaskedLong goal
    • inslen

      protected final int inslen
    • offset

      protected final int offset
  • Method Details

    • computeHash

      protected int computeHash()
      Specified by:
      computeHash in class AssemblyResolution
    • withRight

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

      public 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. Even though the actual encoding cannot yet be determined, its length can.
      Returns:
      the total expected length (including the offset)
    • isError

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

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

      protected String lineToString()
      Description copied from class: AssemblyResolution
      Display the resolution result in one line (omitting child details)
      Specified by:
      lineToString in class AssemblyResolution
      Returns:
      the display description
    • shift

      public AssemblyResolvedBackfill shift(int amt)
      Description copied from class: 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 class AssemblyResolution
      Parameters:
      amt - the number of bytes to shift.
      Returns:
      the result
    • parent

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

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