Class AssemblyResolvedBackfill
java.lang.Object
ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolvedBackfill
- All Implemented Interfaces:
Comparable<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 Summary
FieldsModifier and TypeFieldDescriptionprotected final PatternExpressionprotected final MaskedLongprotected final intprotected final intFields inherited from class ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
children, description, right -
Method Summary
Modifier and TypeMethodDescriptionprotected intintGet 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.booleanCheck if this record describes a backfillbooleanisError()Check if this record describes an errorprotected StringDisplay the resolution result in one line (omitting child details)Get this same resolution, pushing its right siblings down to its childrenshift(int amt) Shift the resolution's instruction pattern to the right, if applicablesolve(RecursiveDescentSolver solver, Map<String, Long> vals, AssemblyResolvedPatterns cur) 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.withRight(AssemblyResolution right) Get this same resolution, but with the given right siblingMethods inherited from class ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
backfill, childrenToString, collectAllRight, compareTo, contextOnly, error, error, error, fromPattern, getAllRight, hasChildren, hashCode, instrOnly, nop, nop, resolved, toString, toString, withoutRight
-
Field Details
-
exp
-
goal
-
inslen
protected final int inslen -
offset
protected final int offset
-
-
Method Details
-
computeHash
protected int computeHash()- Specified by:
computeHashin classAssemblyResolution
-
withRight
Description copied from class:AssemblyResolutionGet this same resolution, but with the given right sibling- Specified by:
withRightin classAssemblyResolution- 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:AssemblyResolutionCheck if this record describes an error- Specified by:
isErrorin classAssemblyResolution- Returns:
- true if the record is an error
-
isBackfill
public boolean isBackfill()Description copied from class:AssemblyResolutionCheck if this record describes a backfill- Specified by:
isBackfillin classAssemblyResolution- Returns:
- true if the record is a backfill
-
lineToString
Description copied from class:AssemblyResolutionDisplay the resolution result in one line (omitting child details)- Specified by:
lineToStringin classAssemblyResolution- Returns:
- the display description
-
shift
Description copied from class:AssemblyResolutionShift the resolution's instruction pattern to the right, if applicableThis also shifts any backfill and forbidden pattern records.
- Specified by:
shiftin classAssemblyResolution- Parameters:
amt- the number of bytes to shift.- Returns:
- the result
-
parent
Description copied from class:AssemblyResolutionGet this same resolution, pushing its right siblings down to its children- Specified by:
parentin classAssemblyResolution
-
solve
public AssemblyResolution solve(RecursiveDescentSolver solver, Map<String, Long> vals, AssemblyResolvedPatterns cur) 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 isinst_next. This method will not throwNeedsBackfillException, since that would imply the missing symbol(s) from the original attempt are still missing. Instead, the method returns an instance ofAssemblyResolvedError.- 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
-