Package ghidra.program.model.lang
Class ParamEntry
- java.lang.Object
-
- ghidra.program.model.lang.ParamEntry
-
public class ParamEntry extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_FLOAT
static int
TYPE_PTR
static int
TYPE_UNKNOWN
-
Constructor Summary
Constructors Constructor Description ParamEntry(int grp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(ParamEntry op2)
int
countJoinOverlap(java.util.List<ParamEntry> curList)
boolean
equals(java.lang.Object obj)
int
getAddrBySlot(int slotnum, int sz, VarnodeData res)
Return the storage address assigned when allocating something of size -sz- assuming -slotnum- slots have already been assigned.long
getAddressBase()
int
getAlign()
int
getGroup()
int
getGroupSize()
Varnode[]
getJoinRecord()
static int
getMetatype(DataType tp)
int
getMinSize()
int
getSize()
int
getSlot(Address addr, int skip)
Assuming the address is contained in this entry and we -skip- to a certain byte return the slot associated with that byteAddressSpace
getSpace()
int
getType()
int
hashCode()
boolean
isBigEndian()
boolean
isExclusion()
boolean
isFloatExtended()
boolean
isGrouped()
boolean
isNonOverlappingJoin()
boolean
isReverseStack()
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, java.util.List<ParamEntry> curList, boolean grouped)
void
saveXml(java.lang.StringBuilder buffer)
static boolean
unsignedCompare(long a, long b)
Unsigned less-than operation
-
-
-
Field Detail
-
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN
- See Also:
- Constant Field Values
-
TYPE_PTR
public static final int TYPE_PTR
- See Also:
- Constant Field Values
-
TYPE_FLOAT
public static final int TYPE_FLOAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getGroup
public int getGroup()
-
getGroupSize
public int getGroupSize()
-
getSize
public int getSize()
-
getMinSize
public int getMinSize()
-
getAlign
public int getAlign()
-
getAddressBase
public long getAddressBase()
-
getType
public int getType()
-
isExclusion
public boolean isExclusion()
-
isReverseStack
public boolean isReverseStack()
-
isGrouped
public boolean isGrouped()
-
isBigEndian
public boolean isBigEndian()
-
isFloatExtended
public boolean isFloatExtended()
-
isNonOverlappingJoin
public boolean isNonOverlappingJoin()
- Returns:
- true if at least one piece of a join doesn't overlap with another ParamEntry
-
getSpace
public AddressSpace getSpace()
-
getJoinRecord
public Varnode[] getJoinRecord()
-
contains
public boolean contains(ParamEntry op2)
-
justifiedContain
public int justifiedContain(Address addr, int sz)
-
getSlot
public int getSlot(Address addr, int skip)
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
public int getAddrBySlot(int slotnum, int sz, VarnodeData res)
Return the storage address assigned when allocating something of size -sz- assuming -slotnum- slots have already been assigned. Set res.space 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 assignedres
- the final storage address- Returns:
- slotnum plus the number of slots used
-
countJoinOverlap
public int countJoinOverlap(java.util.List<ParamEntry> curList)
-
saveXml
public void saveXml(java.lang.StringBuilder buffer)
-
restoreXml
public void restoreXml(XmlPullParser parser, CompilerSpec cspec, java.util.List<ParamEntry> curList, boolean grouped) throws XmlParseException
- Throws:
XmlParseException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
unsignedCompare
public static boolean unsignedCompare(long a, long b)
Unsigned less-than operation- Parameters:
a
- is the first operandb
- is the second operand- Returns:
- return true is a is less than b, where a and b are interpreted as unsigned integers
-
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
-
getMetatype
public static int getMetatype(DataType tp)
-
orderWithinGroup
public static void orderWithinGroup(ParamEntry entry1, ParamEntry entry2) throws XmlParseException
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
-
-