Package ghidra.program.model.lang
Class RegisterBuilder
- java.lang.Object
-
- ghidra.program.model.lang.RegisterBuilder
-
public class RegisterBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RegisterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAlias(java.lang.String registerName, java.lang.String alias)
Add an alias to a previously defined register.boolean
addLaneSize(java.lang.String registerName, int laneSizeInBytes)
Add a vector lane size to the specified register.void
addRegister(Register register)
void
addRegister(java.lang.String name, java.lang.String description, Address address, int numBytes, boolean bigEndian, int typeFlags)
void
addRegister(java.lang.String name, java.lang.String description, Address address, int numBytes, int leastSignificantBit, int bitLength, boolean bigEndian, int typeFlags)
Address
getProcessContextAddress()
Returns the processor context address of the first context register added to this builder.Register
getRegister(java.lang.String name)
Returns the register with the given name;RegisterManager
getRegisterManager()
Compute current register collection and instantiate aRegisterManager
boolean
renameRegister(java.lang.String oldName, java.lang.String newName)
Rename a register.boolean
setFlag(java.lang.String registerName, int registerFlag)
Set a register flag for the specified registerboolean
setGroup(java.lang.String registerName, java.lang.String groupName)
Set the group name for the specified register
-
-
-
Method Detail
-
addRegister
public void addRegister(java.lang.String name, java.lang.String description, Address address, int numBytes, boolean bigEndian, int typeFlags)
-
addRegister
public void addRegister(java.lang.String name, java.lang.String description, Address address, int numBytes, int leastSignificantBit, int bitLength, boolean bigEndian, int typeFlags)
-
addRegister
public void addRegister(Register register)
-
getProcessContextAddress
public Address getProcessContextAddress()
Returns the processor context address of the first context register added to this builder.- Returns:
- context address
-
getRegisterManager
public RegisterManager getRegisterManager()
Compute current register collection and instantiate aRegisterManager
- Returns:
- new register manager instance
-
getRegister
public Register getRegister(java.lang.String name)
Returns the register with the given name;- Parameters:
name
- the name of the register to retrieve- Returns:
- register or null if not found
-
renameRegister
public boolean renameRegister(java.lang.String oldName, java.lang.String newName)
Rename a register. This allows generic register names declared within the langauge specification (*.slaspec) to be renamed for a processor variant specification (*.pspec).- Parameters:
oldName
- original register namenewName
- new register name- Returns:
- true if rename was successful, else false
-
addAlias
public boolean addAlias(java.lang.String registerName, java.lang.String alias)
Add an alias to a previously defined register.- Parameters:
registerName
- defined registeralias
- alias to be added to defined register- Returns:
- true if alias addition was successful, else false
-
setGroup
public boolean setGroup(java.lang.String registerName, java.lang.String groupName)
Set the group name for the specified register- Parameters:
registerName
- register namegroupName
- group name- Returns:
- true if register was found, else false
-
setFlag
public boolean setFlag(java.lang.String registerName, int registerFlag)
Set a register flag for the specified register- Parameters:
registerName
- register nameregisterFlag
- Register defined flag bit(s)- Returns:
- true if register was found, else false
-
addLaneSize
public boolean addLaneSize(java.lang.String registerName, int laneSizeInBytes)
Add a vector lane size to the specified register.- Parameters:
registerName
- register namelaneSizeInBytes
- the size of the lane to add in bytes- Returns:
- true if register was found, else false
- Throws:
java.lang.UnsupportedOperationException
- if register is unable to support the definition of lanes.java.lang.IllegalArgumentException
- iflaneSizeInBytes
is invalid
-
-