public class

CallingConventionUtil

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

Class Overview

Utility routines for calling convention objects.

Summary

Public Constructors
CallingConventionUtil()
Public Methods
static Set<Long> getInputRegisters(ICallingConvention cc, Endianness endian)
static Collection<Long> getOrderedSingleInputRegisters(ICallingConvention cc, Endianness endian)
static Collection<Long> getOrderedSingleOutputRegisters(ICallingConvention cc, Endianness endian)
static Set<Long> getOutputRegisters(ICallingConvention cc, Endianness endian)
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).
static Set<Long> getParameterRegisters(ICallingConventionManager ccManager, Endianness endian)
Collect parameter registers from all defined calling conventions in the given manager.
static Set<Long> getSpoiledRegisters(ICallingConventionManager ccManager)
Collect spoiled registers from all defined calling conventions in the given manager.
static boolean isValidForProcessor(ICallingConvention cc, List<ProcessorType> candidateProcessors)
static CallingConventionBuilder parse(String data)
Parse and create a new calling convention object.
static ICallingConvention parseAndBuild(String data, boolean build)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CallingConventionUtil ()

Public Methods

public static Set<Long> getInputRegisters (ICallingConvention cc, Endianness endian)

Parameters
cc calling convention
Returns
  • a set of native register ids

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

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

public static Set<Long> getOutputRegisters (ICallingConvention cc, Endianness endian)

Parameters
cc calling convention
Returns
  • a set of native register ids

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).

Returns
  • -1 if undetermined

public static Set<Long> getParameterRegisters (ICallingConventionManager ccManager, Endianness endian)

Collect parameter registers from all defined calling conventions in the given manager.

Returns
  • ids of the registers used as parameter in the known calling conventions

public static Set<Long> getSpoiledRegisters (ICallingConventionManager ccManager)

Collect spoiled registers from all defined calling conventions in the given manager.

Returns
  • ids of the registers used as parameter in the known calling conventions

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

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)

public static ICallingConvention parseAndBuild (String data, boolean build)