Class RegisterBuilder

java.lang.Object
ghidra.program.model.lang.RegisterBuilder

public class RegisterBuilder extends Object
  • Constructor Details

    • RegisterBuilder

      public RegisterBuilder()
  • Method Details

    • addRegister

      public void addRegister(String name, String description, Address address, int numBytes, boolean bigEndian, int typeFlags)
    • addRegister

      public void addRegister(String name, 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 a RegisterManager
      Returns:
      new register manager instance
    • getRegister

      public Register getRegister(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(String oldName, String newName)
      Rename a register. This allows generic register names declared within the language specification (*.slaspec) to be renamed for a processor variant specification (*.pspec).
      Parameters:
      oldName - original register name
      newName - new register name
      Returns:
      true if rename was successful, else false
    • addAlias

      public boolean addAlias(String registerName, String alias)
      Add an alias to a previously defined register.
      Parameters:
      registerName - defined register
      alias - alias to be added to defined register
      Returns:
      true if alias addition was successful, else false
    • setGroup

      public boolean setGroup(String registerName, String groupName)
      Set the group name for the specified register
      Parameters:
      registerName - register name
      groupName - group name
      Returns:
      true if register was found, else false
    • setFlag

      public boolean setFlag(String registerName, int registerFlag)
      Set a register flag for the specified register
      Parameters:
      registerName - register name
      registerFlag - Register defined flag bit(s)
      Returns:
      true if register was found, else false
    • addLaneSize

      public boolean addLaneSize(String registerName, int laneSizeInBytes)
      Add a vector lane size to the specified register.
      Parameters:
      registerName - register name
      laneSizeInBytes - the size of the lane to add in bytes
      Returns:
      true if register was found, else false
      Throws:
      UnsupportedOperationException - if register is unable to support the definition of lanes.
      IllegalArgumentException - if laneSizeInBytes is invalid