Class PatchStep
- All Implemented Interfaces:
Step,Comparable<Step>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.trace.model.time.schedule.Step
Step.StepType -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclone()longcoalescePatches(Language language, List<Step> steps) compareStep(Step step) Richly compare this step to anotherbooleanvoidexecute(PcodeThread<?> emuThread, Stepper stepper, TaskMonitor monitor) protected static voidgenerateMemorySleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) protected static voidgenerateRegisterSleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) generateSleigh(Language language, Address address, byte[] data) Generate multiple lines of Sleigh, all to set a single variablegenerateSleigh(Language language, Map<AddressSpace, SemisparseByteArray> patches) protected static voidgenerateSleigh(List<String> result, Language language, Address address, byte[] data) protected static voidgenerateSleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) static StringgenerateSleighLine(Language language, Address address, byte[] data) Generate a single line of Sleighstatic StringgenerateSleighLine(Language language, Address address, byte[] data, int length) Generate a single line of Sleighprotected booleangetPatchBranchOp(Language language, Map<AddressSpace, SemisparseByteArray> result, PcodeOp op) protected booleangetPatchCopyOp(Language language, Map<AddressSpace, SemisparseByteArray> result, PcodeOp op) longprotected Map<AddressSpace, SemisparseByteArray> getPatches(Language language) protected booleangetPatchStoreOp(Language language, Map<AddressSpace, SemisparseByteArray> result, PcodeOp op) longlonglonggetType()inthashCode()booleanisCompatible(Step step) Check if the given step can be combined with this oneprotected static booleanisContained(Register r, ULongSpan.ULongSpanSet remains) booleanisNop()protected voidmergePatches(Map<AddressSpace, SemisparseByteArray> into, Map<AddressSpace, SemisparseByteArray> from) static PatchSteplongrewind(long count) Subtract from the count of this stepprotected static ULongSpantoString()toString(TraceSchedule.TimeRadix radix) Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.trace.model.time.schedule.Step
compareStepType, compareTo, execute, getThread, getTypeOrder, isEventThread
-
Field Details
-
threadKey
protected final long threadKey -
sleigh
-
hashCode
protected int hashCode
-
-
Constructor Details
-
PatchStep
-
-
Method Details
-
generateSleighLine
public static String generateSleighLine(Language language, Address address, byte[] data, int length) Generate a single line of SleighNote that when length is greater than 8, this will generate constants which are too large for the Java implementation of Sleigh. Use
generateSleigh(Language, Address, byte[])instead to write the variable in chunks.- Parameters:
language- the target languageaddress- the (start) address of the variabledata- the bytes to write to the variablelength- the length of the variable- Returns:
- the Sleigh code
-
generateSleighLine
Generate a single line of Sleigh- Parameters:
language- the target languageaddress- the (start) address of the variabledata- the bytes to write to the variable- Returns:
- the Sleigh code
- See Also:
-
generateSleigh
Generate multiple lines of Sleigh, all to set a single variable- Parameters:
language- the target languageaddress- the (start) address of the variabledata- the bytes to write to the variable- Returns:
- the lines of Sleigh code
-
generateSleigh
-
generateSleigh
protected static List<String> generateSleigh(Language language, Map<AddressSpace, SemisparseByteArray> patches) -
generateSleigh
protected static void generateSleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) -
generateMemorySleigh
protected static void generateMemorySleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) -
spanOfRegister
-
isContained
-
generateRegisterSleigh
protected static void generateRegisterSleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) -
parse
-
hashCode
public int hashCode() -
equals
-
toString
-
toString
-
getType
-
getSkipCount
public long getSkipCount()- Specified by:
getSkipCountin interfaceStep
-
isNop
public boolean isNop() -
getThreadKey
public long getThreadKey()- Specified by:
getThreadKeyin interfaceStep
-
getTickCount
public long getTickCount()- Specified by:
getTickCountin interfaceStep
-
getPatchCount
public long getPatchCount()- Specified by:
getPatchCountin interfaceStep
-
isCompatible
Description copied from interface:StepCheck if the given step can be combined with this oneTwo steps applied to the same thread can just be summed. If the given step applies to the "last thread" or to the same thread as this step, then it can be combined.
- Specified by:
isCompatiblein interfaceStep- Parameters:
step- the second step- Returns:
- true if combinable, false otherwise.
-
addTo
-
subtract
-
clone
-
rewind
public long rewind(long count) Description copied from interface:StepSubtract from the count of this stepIf this step has a count exceeding that given, then this method simply subtracts the given number from the
tickCountand returns the (negative) difference. If this step has exactly the count given, this method sets the count to 0 and returns 0, indicating this step should be removed from the sequence. If the given count exceeds that of this step, this method sets the count to 0 and returns the (positive) difference, indicating this step should be removed from the sequence, and the remaining steps rewound from the preceding step. -
compareStep
Description copied from interface:StepRichly compare this step to another- Specified by:
compareStepin interfaceStep- Parameters:
step- the object of comparison (this being the subject)- Returns:
- a result describing the relationship from subject to object
-
execute
public void execute(PcodeThread<?> emuThread, Stepper stepper, TaskMonitor monitor) throws CancelledException - Specified by:
executein interfaceStep- Throws:
CancelledException
-
coalescePatches
- Specified by:
coalescePatchesin interfaceStep
-
mergePatches
protected void mergePatches(Map<AddressSpace, SemisparseByteArray> into, Map<AddressSpace, SemisparseByteArray> from) -
getPatches
-
getPatchCopyOp
protected boolean getPatchCopyOp(Language language, Map<AddressSpace, SemisparseByteArray> result, PcodeOp op) -
getPatchStoreOp
protected boolean getPatchStoreOp(Language language, Map<AddressSpace, SemisparseByteArray> result, PcodeOp op) -
getPatchBranchOp
protected boolean getPatchBranchOp(Language language, Map<AddressSpace, SemisparseByteArray> result, PcodeOp op)
-