Class VarargsFilter
java.lang.Object
ghidra.program.model.lang.protorules.VarargsFilter
- All Implemented Interfaces:
QualifierFilter
A filter that selects a range of function parameters that are considered optional.
If the underlying function prototype takes variable arguments, the first n
parameters (as determined by PrototypePieces.firstVarArgSlot) are considered non-optional.
If additional data-types are provided beyond the initial n, these are considered optional.
By default this filter matches on all parameters in a prototype with variable arguments.
Optionally, it can filter on a range of parameters that are specified relative to the
first variable argument.
<varargs first="0"/>
- matches optional arguments but not non-optional ones.
<varargs first="0" last="0"/>
- matches the first optional argument.
<varargs first="-1"/>
- matches the last non-optional argument and all optional ones.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Make a copy of this qualifiervoid
Save this filter and its configuration to a streamboolean
filter
(PrototypePieces proto, int pos) Test whether the given function prototype meets this filter's criteriaboolean
Test if the given filter is configured and performs identically to thisvoid
restoreXml
(XmlPullParser parser) Configure details of the criteria being filtered from the given stream
-
Constructor Details
-
VarargsFilter
public VarargsFilter() -
VarargsFilter
public VarargsFilter(int first, int last)
-
-
Method Details
-
clone
Description copied from interface:QualifierFilter
Make a copy of this qualifier- Specified by:
clone
in interfaceQualifierFilter
- Overrides:
clone
in classObject
- Returns:
- the copy
-
isEquivalent
Description copied from interface:QualifierFilter
Test if the given filter is configured and performs identically to this- Specified by:
isEquivalent
in interfaceQualifierFilter
- Parameters:
op
- is the given filter- Returns:
- true if the two filters are equivalent
-
filter
Description copied from interface:QualifierFilter
Test whether the given function prototype meets this filter's criteria- Specified by:
filter
in interfaceQualifierFilter
- Parameters:
proto
- is the high-level description of the function prototype to testpos
- is the position of a specific output (pos=-1) or input (pos >=0) in context- Returns:
- true if the prototype meets the criteria, false otherwise
-
encode
Description copied from interface:QualifierFilter
Save this filter and its configuration to a stream- Specified by:
encode
in interfaceQualifierFilter
- Parameters:
encoder
- is the stream encoder- Throws:
IOException
- for problems writing to the stream
-
restoreXml
Description copied from interface:QualifierFilter
Configure details of the criteria being filtered from the given stream- Specified by:
restoreXml
in interfaceQualifierFilter
- Parameters:
parser
- is the given stream decoder- Throws:
XmlParseException
- if there are problems with the stream
-