Package ghidra.program.model.lang
Class ParamListStandard
- java.lang.Object
-
- ghidra.program.model.lang.ParamListStandard
-
- All Implemented Interfaces:
ParamList
- Direct Known Subclasses:
ParamListStandardOut
public class ParamListStandard extends java.lang.Object implements ParamList
Standard analysis for parameter lists
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ghidra.program.model.lang.ParamList
ParamList.WithSlotRec
-
-
Field Summary
Fields Modifier and Type Field Description protected ParamEntry[]
entry
protected int
numgroup
protected int
pointermax
protected AddressSpace
spacebase
protected boolean
thisbeforeret
-
Constructor Summary
Constructors Constructor Description ParamListStandard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VariableStorage
assignAddress(Program program, DataType tp, int[] status, boolean ishiddenret, boolean isindirect)
Assign next available memory chunk to typevoid
assignMap(Program prog, DataType[] proto, boolean isinput, java.util.ArrayList<VariableStorage> res, boolean addAutoParams)
Given a list of datatypes, calculate the storage locations used for passing those datatypesVariableStorage[]
getPotentialRegisterStorage(Program prog)
Get a list of all parameter storage locations consisting of a single registerint
getStackParameterAlignment()
Return the amount of alignment used for parameters passed on the stack, or -1 if there are no stack paramsjava.lang.Long
getStackParameterOffset()
Find the boundary offset that separates parameters on the stack from other local variables This is usually the address of the first stack parameter, but if the stack grows positive, this is the first address AFTER the parameters on the stackboolean
isThisBeforeRetPointer()
boolean
possibleParamWithSlot(Address loc, int size, ParamList.WithSlotRec res)
Determine if a particular address range is a possible parameter, and if so what slot(s) it occupiesvoid
restoreXml(XmlPullParser parser, CompilerSpec cspec, boolean normalstack)
-
-
-
Field Detail
-
numgroup
protected int numgroup
-
pointermax
protected int pointermax
-
thisbeforeret
protected boolean thisbeforeret
-
entry
protected ParamEntry[] entry
-
spacebase
protected AddressSpace spacebase
-
-
Method Detail
-
assignAddress
protected VariableStorage assignAddress(Program program, DataType tp, int[] status, boolean ishiddenret, boolean isindirect)
Assign next available memory chunk to type- Parameters:
tp
- type being assigned storagestatus
- status from previous assignments- Returns:
- Address of assigned memory chunk
-
assignMap
public void assignMap(Program prog, DataType[] proto, boolean isinput, java.util.ArrayList<VariableStorage> res, boolean addAutoParams)
Description copied from interface:ParamList
Given a list of datatypes, calculate the storage locations used for passing those datatypes- Specified by:
assignMap
in interfaceParamList
- Parameters:
prog
- is the active prograproto
- is the list of datatypesisinput
- is true if this parameter list is being processed for input arguments, false for outputres
- is the vector for holding the VariableStorage corresponding to datatypesaddAutoParams
- if true add/process auto-parameters
-
getPotentialRegisterStorage
public VariableStorage[] getPotentialRegisterStorage(Program prog)
Description copied from interface:ParamList
Get a list of all parameter storage locations consisting of a single register- Specified by:
getPotentialRegisterStorage
in interfaceParamList
- Returns:
-
restoreXml
public void restoreXml(XmlPullParser parser, CompilerSpec cspec, boolean normalstack) throws XmlParseException
- Specified by:
restoreXml
in interfaceParamList
- Throws:
XmlParseException
-
getStackParameterAlignment
public int getStackParameterAlignment()
Description copied from interface:ParamList
Return the amount of alignment used for parameters passed on the stack, or -1 if there are no stack params- Specified by:
getStackParameterAlignment
in interfaceParamList
- Returns:
- the alignment
-
getStackParameterOffset
public java.lang.Long getStackParameterOffset()
Description copied from interface:ParamList
Find the boundary offset that separates parameters on the stack from other local variables This is usually the address of the first stack parameter, but if the stack grows positive, this is the first address AFTER the parameters on the stack- Specified by:
getStackParameterOffset
in interfaceParamList
- Returns:
-
possibleParamWithSlot
public boolean possibleParamWithSlot(Address loc, int size, ParamList.WithSlotRec res)
Description copied from interface:ParamList
Determine if a particular address range is a possible parameter, and if so what slot(s) it occupies- Specified by:
possibleParamWithSlot
in interfaceParamList
- Parameters:
loc
- is the starting address of the rangesize
- is the size of the range in bytesres
- holds the resulting slot and slotsize- Returns:
- true if the range is a possible parameter
-
isThisBeforeRetPointer
public boolean isThisBeforeRetPointer()
- Specified by:
isThisBeforeRetPointer
in interfaceParamList
-
-