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 Object
implements ProgramContext, DefaultProgramContext
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Register
Returns the base context register.Gets the registers for this context that are used for processor context states.final RegisterValue
final RegisterValue
getFlowValue
(RegisterValue value) Modify register value to eliminate non-flowing bitsGet underlying language associated with this context and its registersfinal RegisterValue
getNonFlowValue
(RegisterValue value) Modify register value to only include non-flowing bitsfinal Register
getRegister
(String name) Get a Register object given the name of a registerGet an alphabetical sorted unmodifiable list of original register names (including context registers).Get all the register descriptions defined for this program context.final boolean
protected void
Initialize context for the specified languagefinal void
Set the initial disassembly context to be used when initiating disassmblyMethods 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 Details
-
language
-
baseContextRegister
-
defaultDisassemblyContext
-
-
Constructor Details
-
AbstractProgramContext
-
-
Method Details
-
getLanguage
Get underlying language associated with this context and its registers- Returns:
- language
-
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
Modify register value to eliminate non-flowing bits- Specified by:
getFlowValue
in interfaceProgramContext
- Parameters:
value
- context register value to be modified- Returns:
- value suitable for flowing
-
getNonFlowValue
Modify register value to only include non-flowing bits- Specified by:
getNonFlowValue
in interfaceProgramContext
- Parameters:
value
- context register value to be modified- Returns:
- new value or null if value does not correspond to a context register or non-flowing context fields have not been defined
-
init
Initialize context for the specified language- Parameters:
lang
- processor language for which this context applies
-
getContextRegisters
Description copied from interface:ProgramContext
Gets the registers for this context that are used for processor context states.- Specified by:
getContextRegisters
in interfaceProgramContext
- Returns:
- all processor context registers
-
getRegister
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
Description copied from interface:ProgramContext
Get an alphabetical sorted unmodifiable list of original register names (including context registers). Names correspond to orignal register name and not aliases which may be defined.- Specified by:
getRegisterNames
in interfaceProgramContext
- Returns:
- alphabetical sorted unmodifiable list of original register names.
-
getRegisters
Description copied from interface:ProgramContext
Get all the register descriptions defined for this program context.- Specified by:
getRegisters
in interfaceProgramContext
- Returns:
- unmodifiable list of defined register descriptions
-
getBaseContextRegister
Description copied from interface:ProgramContext
Returns the base context register.- Specified by:
getBaseContextRegister
in interfaceProgramContext
- Returns:
- the base context register.
-
getDefaultDisassemblyContext
- Specified by:
getDefaultDisassemblyContext
in interfaceProgramContext
- Returns:
- Get the current default disassembly context to be used when initiating disassmbly
-
setDefaultDisassemblyContext
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
-