decompiler 1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::VarargsFilter Class Reference

A filter that selects a range of function parameters that are considered optional. More...

#include <modelrules.hh>

Inheritance diagram for ghidra::VarargsFilter:
ghidra::QualifierFilter

Public Member Functions

 VarargsFilter (void)
 Constructor for use with decode.
 
 VarargsFilter (int4 first, int4 last)
 Constructor.
 
virtual QualifierFilterclone (void) const
 Make a copy of this qualifier. More...
 
virtual bool filter (const PrototypePieces &proto, int4 pos) const
 Test whether the given function prototype meets this filter's criteria. More...
 
virtual void decode (Decoder &decoder)
 Configure details of the criteria being filtered from the given stream. More...
 
- Public Member Functions inherited from ghidra::QualifierFilter
virtual ~QualifierFilter (void)
 Destructor.
 
virtual QualifierFilterclone (void) const =0
 Make a copy of this qualifier. More...
 
virtual bool filter (const PrototypePieces &proto, int4 pos) const =0
 Test whether the given function prototype meets this filter's criteria. More...
 
virtual void decode (Decoder &decoder)
 Configure details of the criteria being filtered from the given stream. More...
 

Private Attributes

int4 firstPos
 Start of range to match (offset relative to first variable arg)
 
int4 lastPos
 End of range to match.
 

Additional Inherited Members

- Static Public Member Functions inherited from ghidra::QualifierFilter
static QualifierFilterdecodeFilter (Decoder &decoder)
 Try to instantiate a qualifier filter. More...
 

Detailed Description

A filter that selects a range of function parameters that are considered optional.

If the underlying function prototype is considered to take 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 any parameter in a prototype with variable arguments. Optionally, it can filter on a range of parameters that are specified relative to the first variable argument.

Member Function Documentation

◆ clone()

virtual QualifierFilter * ghidra::VarargsFilter::clone ( void  ) const
inlinevirtual

Make a copy of this qualifier.

Returns
the newly allocated copy

Implements ghidra::QualifierFilter.

References firstPos, lastPos, and VarargsFilter().

◆ decode()

void ghidra::VarargsFilter::decode ( Decoder decoder)
virtual

Configure details of the criteria being filtered from the given stream.

Parameters
decoderis the given stream decoder

Reimplemented from ghidra::QualifierFilter.

References ghidra::Decoder::closeElement(), firstPos, ghidra::Decoder::getNextAttributeId(), lastPos, ghidra::Decoder::openElement(), and ghidra::Decoder::readSignedInteger().

◆ filter()

bool ghidra::VarargsFilter::filter ( const PrototypePieces proto,
int4  pos 
) const
virtual

Test whether the given function prototype meets this filter's criteria.

Parameters
protois the high-level description of the function prototype to test
posis the position of a specific output (pos=-1) or input (pos >=0) in context
Returns
true if the prototype meets the criteria, false otherwise

Implements ghidra::QualifierFilter.

References firstPos, ghidra::PrototypePieces::firstVarArgSlot, and lastPos.


The documentation for this class was generated from the following files: