Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::ProtoParameter Class Referenceabstract

A function parameter viewed as a name, data-type, and storage address. More...

#include <fspec.hh>

Inheritance diagram for ghidra::ProtoParameter:
[legend]

Public Member Functions

 ProtoParameter (void)
 Constructor.
 
virtual ~ProtoParameter (void)
 Destructor.
 
virtual const string & getName (void) const =0
 Get the name of the parameter ("" for return value)
 
virtual DatatypegetType (void) const =0
 Get the data-type associate with this.
 
virtual Address getAddress (void) const =0
 Get the storage address for this parameter.
 
virtual int4 getSize (void) const =0
 Get the number of bytes occupied by this parameter.
 
virtual bool isTypeLocked (void) const =0
 Is the parameter data-type locked.
 
virtual bool isNameLocked (void) const =0
 Is the parameter name locked.
 
virtual bool isSizeTypeLocked (void) const =0
 Is the size of the parameter locked.
 
virtual bool isThisPointer (void) const =0
 Is this the "this" pointer for a class method.
 
virtual bool isIndirectStorage (void) const =0
 Is this really a pointer to the true parameter.
 
virtual bool isHiddenReturn (void) const =0
 Is this a pointer to storage for a return value.
 
virtual bool isNameUndefined (void) const =0
 Is the name of this parameter undefined.
 
virtual void setTypeLock (bool val)=0
 Toggle the lock on the data-type.
 
virtual void setNameLock (bool val)=0
 Toggle the lock on the name.
 
virtual void setThisPointer (bool val)=0
 Toggle whether this is the "this" pointer for a class method.
 
virtual void overrideSizeLockType (Datatype *ct)=0
 Change (override) the data-type of a size-locked parameter.
 
virtual void resetSizeLockType (TypeFactory *factory)=0
 Clear this parameter's data-type preserving any size-lock.
 
virtual ProtoParameterclone (void) const =0
 Clone the parameter.
 
virtual SymbolgetSymbol (void) const =0
 Retrieve the formal Symbol associated with this parameter.
 
bool operator== (const ProtoParameter &op2) const
 Compare storage location and data-type for equality.
 
bool operator!= (const ProtoParameter &op2) const
 Compare storage location and data-type for inequality.
 

Detailed Description

A function parameter viewed as a name, data-type, and storage address.

This is the base class, with derived classes determining what is backing up the information, whether is it a formal Symbol or just internal storage. Both input parameters and return values can be represented with this object.

Member Function Documentation

◆ clone()

virtual ProtoParameter * ghidra::ProtoParameter::clone ( void  ) const
pure virtual

◆ getAddress()

◆ getName()

virtual const string & ghidra::ProtoParameter::getName ( void  ) const
pure virtual

◆ getSize()

◆ getSymbol()

virtual Symbol * ghidra::ProtoParameter::getSymbol ( void  ) const
pure virtual

Retrieve the formal Symbol associated with this parameter.

If there is no backing symbol an exception is thrown

Returns
the backing Symbol object

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::PrintC::emitPrototypeInputs().

◆ getType()

◆ isHiddenReturn()

virtual bool ghidra::ProtoParameter::isHiddenReturn ( void  ) const
pure virtual

Is this a pointer to storage for a return value.

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::ProtoStoreInternal::encode(), and ghidra::FuncProto::updateThisPointer().

◆ isIndirectStorage()

virtual bool ghidra::ProtoParameter::isIndirectStorage ( void  ) const
pure virtual

Is this really a pointer to the true parameter.

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::ProtoStoreInternal::decode(), and ghidra::ProtoStoreInternal::encode().

◆ isNameLocked()

virtual bool ghidra::ProtoParameter::isNameLocked ( void  ) const
pure virtual

Is the parameter name locked.

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::ProtoStoreInternal::encode(), and ghidra::ActionNameVars::makeRec().

◆ isNameUndefined()

virtual bool ghidra::ProtoParameter::isNameUndefined ( void  ) const
pure virtual

Is the name of this parameter undefined.

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::ActionNameVars::makeRec().

◆ isSizeTypeLocked()

virtual bool ghidra::ProtoParameter::isSizeTypeLocked ( void  ) const
pure virtual

◆ isThisPointer()

virtual bool ghidra::ProtoParameter::isThisPointer ( void  ) const
pure virtual

◆ isTypeLocked()

◆ operator!=()

bool ghidra::ProtoParameter::operator!= ( const ProtoParameter op2) const
inline

Compare storage location and data-type for inequality.

Parameters
op2is the parameter to compare with this
Returns
true if the parameters do not share a data-type and storage location

◆ operator==()

bool ghidra::ProtoParameter::operator== ( const ProtoParameter op2) const
inline

Compare storage location and data-type for equality.

Parameters
op2is the parameter to compare with this
Returns
true if the parameters share a data-type and storage location

References getAddress(), and getType().

◆ overrideSizeLockType()

virtual void ghidra::ProtoParameter::overrideSizeLockType ( Datatype ct)
pure virtual

Change (override) the data-type of a size-locked parameter.

The original parameter must have a type-lock and TYPE_UNKNOWN data-type. The size-lock is preserved and this can be cleared back to its TYPE_UNKNOWN state.

Parameters
ctis the overriding data-type

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::FuncProto::updateOutputTypes().

◆ resetSizeLockType()

virtual void ghidra::ProtoParameter::resetSizeLockType ( TypeFactory factory)
pure virtual

Clear this parameter's data-type preserving any size-lock.

The data-type is converted to a TYPE_UNKNOWN of the same size

Parameters
factoryis the TypeFactory that will construct the unknown data-type

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::FuncProto::clearUnlockedOutput().

◆ setNameLock()

virtual void ghidra::ProtoParameter::setNameLock ( bool  val)
pure virtual

Toggle the lock on the name.

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::ProtoStoreInternal::decode().

◆ setThisPointer()

virtual void ghidra::ProtoParameter::setThisPointer ( bool  val)
pure virtual

Toggle whether this is the "this" pointer for a class method.

Implemented in ghidra::ParameterBasic, and ghidra::ParameterSymbol.

Referenced by ghidra::FuncProto::updateThisPointer().

◆ setTypeLock()

virtual void ghidra::ProtoParameter::setTypeLock ( bool  val)
pure virtual

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