Package ghidra.program.model.lang
Class ReadOnlyProcessorContext
- java.lang.Object
-
- ghidra.program.model.lang.ReadOnlyProcessorContext
-
- All Implemented Interfaces:
ProcessorContext,ProcessorContextView
public class ReadOnlyProcessorContext extends java.lang.Object implements ProcessorContext
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyProcessorContext(ProcessorContextView context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearRegister(Register register)Clears the register within this context.RegistergetBaseContextRegister()RegistergetRegister(java.lang.String name)Get a Register given the name of a registerRegister[]getRegisters()Returns all the Registers for the processorRegisterValuegetRegisterValue(Register register)Get the RegisterValue for the given register.java.math.BigIntegergetValue(Register register, boolean signed)Get the contents of a processor register as a BigInteger objectbooleanhasValue(Register register)Returns true if a value is defined for the given register.voidsetRegisterValue(RegisterValue value)Sets the specified register value within this context.voidsetValue(Register register, java.math.BigInteger value)Sets the value for a Register.
-
-
-
Constructor Detail
-
ReadOnlyProcessorContext
public ReadOnlyProcessorContext(ProcessorContextView context)
-
-
Method Detail
-
getBaseContextRegister
public Register getBaseContextRegister()
- Specified by:
getBaseContextRegisterin interfaceProcessorContextView- Returns:
- the base processor context register or null if one has not been defined
-
getRegister
public Register getRegister(java.lang.String name)
Description copied from interface:ProcessorContextViewGet a Register given the name of a register- Specified by:
getRegisterin interfaceProcessorContextView- Parameters:
name- the name of the register.- Returns:
- The register with the given name.
-
getRegisters
public Register[] getRegisters()
Description copied from interface:ProcessorContextViewReturns all the Registers for the processor- Specified by:
getRegistersin interfaceProcessorContextView- Returns:
- all the Registers for the processor
-
getValue
public java.math.BigInteger getValue(Register register, boolean signed)
Description copied from interface:ProcessorContextViewGet the contents of a processor register as a BigInteger object- Specified by:
getValuein interfaceProcessorContextView- Parameters:
register- register to get the value for- Returns:
- a BigInteger object containing the value of the register if a value exists, otherwise null.
-
getRegisterValue
public RegisterValue getRegisterValue(Register register)
Description copied from interface:ProcessorContextViewGet the RegisterValue for the given register.- Specified by:
getRegisterValuein interfaceProcessorContextView- Parameters:
register- register to get the value for- Returns:
- RegisterValue object containing the value of the register if a value exists, otherwise null.
-
hasValue
public boolean hasValue(Register register)
Description copied from interface:ProcessorContextViewReturns true if a value is defined for the given register.- Specified by:
hasValuein interfaceProcessorContextView- Parameters:
register- the register to check for a value.- Returns:
- true if the given register has a value.
-
setValue
public void setValue(Register register, java.math.BigInteger value)
Description copied from interface:ProcessorContextSets the value for a Register.- Specified by:
setValuein interfaceProcessorContext- Parameters:
register- the register to have its value setvalue- the value for the register (null is not permitted).
-
setRegisterValue
public void setRegisterValue(RegisterValue value)
Description copied from interface:ProcessorContextSets the specified register value within this context.- Specified by:
setRegisterValuein interfaceProcessorContext- Parameters:
value- register value
-
clearRegister
public void clearRegister(Register register)
Description copied from interface:ProcessorContextClears the register within this context.- Specified by:
clearRegisterin interfaceProcessorContext- Parameters:
register- register to be cleared.
-
-