Class AssemblyResolvedBackfill
- java.lang.Object
-
- ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
-
- ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolvedBackfill
-
- All Implemented Interfaces:
java.lang.Comparable<AssemblyResolution>
public class AssemblyResolvedBackfill extends AssemblyResolution
AAssemblyResolution
indicating the need to solve an expression in the future Such records are collected within aAssemblyResolvedConstructor
and then solved just before the final result(s) are assembled. This is typically required by instructions that refer to theinst_next
symbol.
-
-
Field Summary
Fields Modifier and Type Field Description protected PatternExpression
exp
protected MaskedLong
goal
protected int
inslen
protected int
offset
protected java.util.Map<java.lang.Integer,java.lang.Object>
res
-
Fields inherited from class ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
children, description
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
computeHash()
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 backfillboolean
isError()
Check if this record describes an errorprotected java.lang.String
lineToString()
Display the resolution result in one line (omitting child details)AssemblyResolvedBackfill
shift(int amt)
Shift the back-fill record's "instruction" pattern to the right.AssemblyResolution
solve(RecursiveDescentSolver solver, java.util.Map<java.lang.String,java.lang.Long> vals, AssemblyResolvedConstructor 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.-
Methods inherited from class ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution
backfill, childrenToString, compareTo, contextOnly, error, error, fromPattern, hasChildren, hashCode, instrOnly, nop, resolved, toString, toString
-
-
-
-
Field Detail
-
exp
protected final PatternExpression exp
-
goal
protected final MaskedLong goal
-
res
protected final java.util.Map<java.lang.Integer,java.lang.Object> res
-
inslen
protected final int inslen
-
offset
protected final int offset
-
-
Method Detail
-
computeHash
protected int computeHash()
- Specified by:
computeHash
in classAssemblyResolution
-
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 classAssemblyResolution
- 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 classAssemblyResolution
- Returns:
- true if the record is a backfill
-
lineToString
protected java.lang.String lineToString()
Description copied from class:AssemblyResolution
Display the resolution result in one line (omitting child details)- Specified by:
lineToString
in classAssemblyResolution
- Returns:
- the display description
-
shift
public AssemblyResolvedBackfill shift(int amt)
Shift the back-fill record's "instruction" pattern to the right.- Parameters:
amt
- the number of bytes to shift the result when solved.- Returns:
- the result
-
solve
public AssemblyResolution solve(RecursiveDescentSolver solver, java.util.Map<java.lang.String,java.lang.Long> vals, AssemblyResolvedConstructor 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
-
-