Package ghidra.program.model.lang
Class ParamEntry
java.lang.Object
ghidra.program.model.lang.ParamEntry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containedBy
(Address addr, int sz) Is this ParamEntry, as a memory range, contained by the given memory range.boolean
contains
(ParamEntry otherEntry) Does this ParamEntry contain another entry (as a subpiece)void
int
getAddrBySlot
(int slotnum, int sz, int typeAlign, ParameterPieces res) Assign the storage address when allocating something of size -sz- assuming -slotnum- slots have already been assigned.long
int
getAlign()
int[]
static StorageClass
int
getGroup()
int
int
getSize()
int
Assuming the address is contained in this entry and we -skip- to a certain byte return the slot associated with that bytegetSpace()
getType()
boolean
intersects
(Address addr, int sz) Does this ParamEntry intersect the given range in some wayboolean
boolean
isEquivalent
(ParamEntry obj) Determine if this ParamEntry is equivalent to another instanceboolean
boolean
boolean
boolean
int
justifiedContain
(Address addr, int sz) static int
justifiedContainAddress
(AddressSpace spc1, long offset1, int sz1, AddressSpace spc2, long offset2, int sz2, boolean forceleft, boolean isBigEndian) Return -1 if (op2,sz2) is not properly contained in (op1,sz1) If it is contained, return the endian aware offset of (op2,sz2) I.e.static void
orderWithinGroup
(ParamEntry entry1, ParamEntry entry2) ParamEntry within a group must be distinguishable by size or by typevoid
restoreXml
(XmlPullParser parser, CompilerSpec cspec, List<ParamEntry> curList, boolean grouped)
-
Constructor Details
-
ParamEntry
public ParamEntry(int grp)
-
-
Method Details
-
getGroup
public int getGroup() -
getAllGroups
public int[] getAllGroups() -
getSize
public int getSize() -
getMinSize
public int getMinSize() -
getAlign
public int getAlign() -
getAddressBase
public long getAddressBase() -
getType
-
isExclusion
public boolean isExclusion() -
isReverseStack
public boolean isReverseStack() -
isGrouped
public boolean isGrouped() -
isOverlap
public boolean isOverlap() -
isBigEndian
public boolean isBigEndian() -
getSpace
-
containedBy
Is this ParamEntry, as a memory range, contained by the given memory range.- Parameters:
addr
- is the starting address of the given memory rangesz
- is the number of bytes in the given memory range- Returns:
- true if this is contained
-
intersects
Does this ParamEntry intersect the given range in some way- Parameters:
addr
- is the starting address of the given rangesz
- is the number of bytes in the given range- Returns:
- true if there is an intersection
-
justifiedContain
-
contains
Does this ParamEntry contain another entry (as a subpiece)- Parameters:
otherEntry
- is the other entry- Returns:
- true if this contains the other entry
-
getSlot
Assuming the address is contained in this entry and we -skip- to a certain byte return the slot associated with that byte- Parameters:
addr
- is the address to check (which MUST be contained)skip
- is the number of bytes to skip- Returns:
- the slot index
-
getAddrBySlot
Assign the storage address when allocating something of size -sz- assuming -slotnum- slots have already been assigned. Set the address to null if the -sz- is too small or if there are not enough slots left- Parameters:
slotnum
- number of slots already assignedsz
- number of bytes to being assignedtypeAlign
- required byte alignment for the parameterres
- will hold the final storage address- Returns:
- slotnum plus the number of slots used
-
encode
- Throws:
IOException
-
restoreXml
public void restoreXml(XmlPullParser parser, CompilerSpec cspec, List<ParamEntry> curList, boolean grouped) throws XmlParseException - Throws:
XmlParseException
-
isEquivalent
Determine if this ParamEntry is equivalent to another instance- Parameters:
obj
- is the other instance- Returns:
- true if they are equivalent
-
justifiedContainAddress
public static int justifiedContainAddress(AddressSpace spc1, long offset1, int sz1, AddressSpace spc2, long offset2, int sz2, boolean forceleft, boolean isBigEndian) Return -1 if (op2,sz2) is not properly contained in (op1,sz1) If it is contained, return the endian aware offset of (op2,sz2) I.e. if the least significant byte of the op2 range falls on the least significant byte of the op1 range, return 0. If it intersects the second least significant, return 1, etc.- Parameters:
spc1
- the first address spaceoffset1
- the first offsetsz1
- size of first spacespc2
- the second address spaceoffset2
- is the second offsetsz2
- size of second spaceforceleft
- is true if containment is forced to be on the left even for big endianisBigEndian
- true if big endian- Returns:
- the endian aware offset or -1
-
getBasicTypeClass
-
orderWithinGroup
ParamEntry within a group must be distinguishable by size or by type- Parameters:
entry1
- is the first being comparedentry2
- is the second being compared- Throws:
XmlParseException
- if the pair is not distinguishable
-