Package ghidra.program.util
Class AbstractProgramContext
- java.lang.Object
-
- ghidra.program.util.AbstractProgramContext
-
- All Implemented Interfaces:
DefaultProgramContext
,ProgramContext
- Direct Known Subclasses:
AbstractStoredProgramContext
,Disassembler.DisassemblerProgramContext
public abstract class AbstractProgramContext extends java.lang.Object implements ProgramContext, DefaultProgramContext
-
-
Field Summary
Fields Modifier and Type Field Description protected Register
baseContextRegister
protected RegisterValue
defaultDisassemblyContext
protected java.util.Map<java.lang.String,Register>
registerNameMap
protected Register[]
registers
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractProgramContext(Register[] registers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Register
getBaseContextRegister()
Returns the base context register.RegisterValue
getDefaultDisassemblyContext()
RegisterValue
getFlowValue(RegisterValue value)
Modify register value to eliminate non-flowing bitsRegisterValue
getNonFlowValue(RegisterValue value)
Modify register value to only include non-flowing bitsRegister[]
getProcessorStateRegisters()
Gets the registers for this context that are used for processor context states.Register
getRegister(java.lang.String name)
Get a Register object given the name of a registerjava.lang.String[]
getRegisterNames()
Returns the list of register namesRegister[]
getRegisters()
Get all the register descriptions defined for this program context.boolean
hasNonFlowingContext()
protected void
initNameMap()
void
setDefaultDisassemblyContext(RegisterValue value)
Set the initial disassembly context to be used when initiating disassmbly-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ghidra.program.model.listing.DefaultProgramContext
getDefaultValue, setDefaultValue
-
Methods inherited from interface ghidra.program.model.listing.ProgramContext
getDefaultRegisterValueAddressRanges, getDefaultRegisterValueAddressRanges, getDefaultValue, getDisassemblyContext, getNonDefaultValue, getRegistersWithValues, getRegisterValue, getRegisterValueAddressRanges, getRegisterValueAddressRanges, getRegisterValueRangeContaining, getValue, hasValueOverRange, remove, setRegisterValue, setValue
-
-
-
-
Field Detail
-
registerNameMap
protected java.util.Map<java.lang.String,Register> registerNameMap
-
registers
protected Register[] registers
-
baseContextRegister
protected Register baseContextRegister
-
defaultDisassemblyContext
protected RegisterValue defaultDisassemblyContext
-
-
Constructor Detail
-
AbstractProgramContext
protected AbstractProgramContext(Register[] registers)
-
-
Method Detail
-
hasNonFlowingContext
public final boolean hasNonFlowingContext()
- Specified by:
hasNonFlowingContext
in interfaceProgramContext
- Returns:
- true if one or more non-flowing context registers fields have been defined within the base processor context register.
-
getFlowValue
public final RegisterValue getFlowValue(RegisterValue value)
Modify register value to eliminate non-flowing bits- Specified by:
getFlowValue
in interfaceProgramContext
- Parameters:
value
-- Returns:
- value suitable for flowing
-
getNonFlowValue
public final RegisterValue getNonFlowValue(RegisterValue value)
Modify register value to only include non-flowing bits- Specified by:
getNonFlowValue
in interfaceProgramContext
- Parameters:
value
-- Returns:
- new value or null
-
initNameMap
protected void initNameMap()
-
getProcessorStateRegisters
public final Register[] getProcessorStateRegisters()
Description copied from interface:ProgramContext
Gets the registers for this context that are used for processor context states.- Specified by:
getProcessorStateRegisters
in interfaceProgramContext
- Returns:
- all processor context registers
-
getRegister
public final Register getRegister(java.lang.String name)
Description copied from interface:ProgramContext
Get a Register object given the name of a register- Specified by:
getRegister
in interfaceProgramContext
- Parameters:
name
- the name of the register.- Returns:
- The register with the given name or null if no register has that name.
-
getRegisterNames
public final java.lang.String[] getRegisterNames()
Description copied from interface:ProgramContext
Returns the list of register names- Specified by:
getRegisterNames
in interfaceProgramContext
-
getRegisters
public final Register[] getRegisters()
Description copied from interface:ProgramContext
Get all the register descriptions defined for this program context.- Specified by:
getRegisters
in interfaceProgramContext
- Returns:
- array of defined register descriptions
-
getBaseContextRegister
public final Register getBaseContextRegister()
Description copied from interface:ProgramContext
Returns the base context register.- Specified by:
getBaseContextRegister
in interfaceProgramContext
- Returns:
- the base context register.
-
getDefaultDisassemblyContext
public final RegisterValue getDefaultDisassemblyContext()
- Specified by:
getDefaultDisassemblyContext
in interfaceProgramContext
- Returns:
- Get the current default disassembly context to be used when initiating disassmbly
-
setDefaultDisassemblyContext
public final void setDefaultDisassemblyContext(RegisterValue value)
Description copied from interface:ProgramContext
Set the initial disassembly context to be used when initiating disassmbly- Specified by:
setDefaultDisassemblyContext
in interfaceProgramContext
- Parameters:
value
- context register value
-
-