Package ghidra.program.model.lang
Class ProgramProcessorContext
java.lang.Object
ghidra.program.model.lang.ProgramProcessorContext
- All Implemented Interfaces:
ProcessorContext,ProcessorContextView
Implementation for the program processor context interface
-
Constructor Summary
ConstructorsConstructorDescriptionProgramProcessorContext(ProgramContext context, Address addr) Constructs a new ProgramProcessorContext that will have the processor state be the state of the given programContext at the given address -
Method Summary
Modifier and TypeMethodDescriptionvoidclearRegister(Register register) Clears the register within this context.getRegister(String name) Get a Register given the name of a registerReturns all the Registers for the processor as an unmodifiable listgetRegisterValue(Register register) Get the RegisterValue for the given register.Get the contents of a processor register as a BigInteger objectbooleanReturns true if a value is defined for the given register.voidsetRegisterValue(RegisterValue value) Sets the specified register value within this context.voidsetValue(Register register, BigInteger value) Sets the value for a Register.
-
Constructor Details
-
ProgramProcessorContext
Constructs a new ProgramProcessorContext that will have the processor state be the state of the given programContext at the given address- Parameters:
context- the programContext which contains the register state at every addressaddr- the address at which to get the register state
-
-
Method Details
-
getBaseContextRegister
- Specified by:
getBaseContextRegisterin interfaceProcessorContextView- Returns:
- the base processor context register or null if one has not been defined
-
getRegisters
Description copied from interface:ProcessorContextViewReturns all the Registers for the processor as an unmodifiable list- Specified by:
getRegistersin interfaceProcessorContextView- Returns:
- all the Registers for the processor
-
getRegister
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.
-
getValue
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
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.
-
setValue
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).- Throws:
ContextChangeException- an illegal attempt to change context was made
-
setRegisterValue
Description copied from interface:ProcessorContextSets the specified register value within this context.- Specified by:
setRegisterValuein interfaceProcessorContext- Parameters:
value- register value- Throws:
ContextChangeException- an illegal attempt to change context was made
-
clearRegister
Description copied from interface:ProcessorContextClears the register within this context.- Specified by:
clearRegisterin interfaceProcessorContext- Parameters:
register- register to be cleared.- Throws:
ContextChangeException- an illegal attempt to change context was made
-
hasValue
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.
- See Also:
-