Class JumpTable

java.lang.Object
ghidra.program.model.pcode.JumpTable

public class JumpTable extends Object
JumpTable found as part of the decompilation of a function
  • Constructor Details

    • JumpTable

      public JumpTable()
    • JumpTable

      public JumpTable(Address addr, ArrayList<Address> destlist, boolean override, int format)
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • decode

      public void decode(Decoder decoder) throws DecoderException
      Decode a JumpTable object from the stream.
      Parameters:
      decoder - is the stream decoder
      Throws:
      DecoderException - for invalid encodings
    • encode

      public void encode(Encoder encoder) throws IOException
      Throws:
      IOException
    • getSwitchAddress

      public Address getSwitchAddress()
    • getCases

      public Address[] getCases()
    • getLabelValues

      public Integer[] getLabelValues()
    • getLoadTables

      public JumpTable.LoadTable[] getLoadTables()
    • getFormatOverride NEW

      public static int getFormatOverride(Function func, Address opAddress)
      Get any case format override for this jumptable.
      Parameters:
      func - is the function with the jumptable
      opAddress - is the address of the call point using the table
      Returns:
      the overriding format if it exists or EquateSymbol.FORMAT_DEFAULT otherwise
    • writeFormat NEW

      public static void writeFormat(Function func, Address opAddress, int displayFormat) throws InvalidInputException
      Write/update the current display format for a JumpTable. The format is stored as a symbol with a name like "format_dec" or "format_char" Any previous existing symbol is removed.
      Parameters:
      func - is the function containing the switch
      opAddress - is the address of the CALLIND
      displayFormat - is the new desired format
      Throws:
      InvalidInputException - for problems writing to the database
    • writeOverride

      public void writeOverride(Function func) throws InvalidInputException
      Throws:
      InvalidInputException
    • readOverride

      public static JumpTable readOverride(Namespace space, SymbolTable symtab)