Class CallingConventionUtil

java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.type.CallingConventionUtil

public class CallingConventionUtil extends Object
Utility routines for calling convention objects.
  • Constructor Details

    • CallingConventionUtil

      public CallingConventionUtil()
  • Method Details

    • getOrderedSingleInputRegisters

      public static Collection<Long> getOrderedSingleInputRegisters(ICallingConvention cc, Endianness endian)
    • getOrderedSingleOutputRegisters

      public static Collection<Long> getOrderedSingleOutputRegisters(ICallingConvention cc, Endianness endian)
    • getInputRegisters

      public static Set<Long> getInputRegisters(ICallingConvention cc, Endianness endian)
      Parameters:
      cc - calling convention
      Returns:
      a set of native register ids
    • getOutputRegisters

      public static Set<Long> getOutputRegisters(ICallingConvention cc, Endianness endian)
      Parameters:
      cc - calling convention
      Returns:
      a set of native register ids
    • getParameterRegisters

      public static Set<Long> getParameterRegisters(ICallingConventionManager ccManager, Endianness endian)
      Collect parameter registers from all defined calling conventions in the given manager.
      Parameters:
      ccManager -
      Returns:
      ids of the registers used as parameter in the known calling conventions
    • getSpoiledRegisters

      public static Set<Long> getSpoiledRegisters(ICallingConventionManager ccManager)
      Collect spoiled registers from all defined calling conventions in the given manager.
      Parameters:
      ccManager -
      Returns:
      ids of the registers used as parameter in the known calling conventions
    • getParameterIndexByArgumentStackOffset

      public static int getParameterIndexByArgumentStackOffset(ICallingConvention cc, IPrototypeItem proto, int stackOffset, int stackSlotSize)
      Given a calling convention and a stack offset, determine a method's parameter index (if the parameter is on the stack on of course).
      Parameters:
      cc -
      proto -
      stackOffset -
      stackSlotSize -
      Returns:
      -1 if undetermined
    • parseAndBuild

      public static ICallingConvention parseAndBuild(String data, boolean build)
      Parameters:
      data -
      build -
      Returns:
    • parse

      public static CallingConventionBuilder parse(String data)
      Parse and create a new calling convention object.
      Parameters:
      data - definition of a calling convention, formatted as yaml data (see doc)
      Returns:
      a calling convention object (the method throws IllegalArgumentException on error)
    • isValidForProcessor

      public static boolean isValidForProcessor(ICallingConvention cc, List<ProcessorType> candidateProcessors)