Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::ParameterBasic Class Reference

A stand-alone parameter with no backing symbol. More...

#include <fspec.hh>

Inheritance diagram for ghidra::ParameterBasic:
[legend]
Collaboration diagram for ghidra::ParameterBasic:
[legend]

Public Member Functions

 ParameterBasic (const string &nm, const Address &ad, Datatype *tp, uint4 fl)
 Construct from components.
 
 ParameterBasic (Datatype *tp)
 Construct a void parameter.
 
virtual const string & getName (void) const
 Get the name of the parameter ("" for return value)
 
virtual DatatypegetType (void) const
 Get the data-type associate with this.
 
virtual Address getAddress (void) const
 Get the storage address for this parameter.
 
virtual int4 getSize (void) const
 Get the number of bytes occupied by this parameter.
 
virtual bool isTypeLocked (void) const
 Is the parameter data-type locked.
 
virtual bool isNameLocked (void) const
 Is the parameter name locked.
 
virtual bool isSizeTypeLocked (void) const
 Is the size of the parameter locked.
 
virtual bool isThisPointer (void) const
 Is this the "this" pointer for a class method.
 
virtual bool isIndirectStorage (void) const
 Is this really a pointer to the true parameter.
 
virtual bool isHiddenReturn (void) const
 Is this a pointer to storage for a return value.
 
virtual bool isNameUndefined (void) const
 Is the name of this parameter undefined.
 
virtual void setTypeLock (bool val)
 Toggle the lock on the data-type.
 
virtual void setNameLock (bool val)
 Toggle the lock on the name.
 
virtual void setThisPointer (bool val)
 Toggle whether this is the "this" pointer for a class method.
 
virtual void overrideSizeLockType (Datatype *ct)
 Change (override) the data-type of a size-locked parameter.
 
virtual void resetSizeLockType (TypeFactory *factory)
 Clear this parameter's data-type preserving any size-lock.
 
virtual ProtoParameterclone (void) const
 Clone the parameter.
 
virtual SymbolgetSymbol (void) const
 Retrieve the formal Symbol associated with this parameter.
 
- Public Member Functions inherited from ghidra::ProtoParameter
 ProtoParameter (void)
 Constructor.
 
virtual ~ProtoParameter (void)
 Destructor.
 
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.
 

Private Attributes

string name
 The name of the parameter, "" for undefined or return value parameters.
 
Address addr
 Storage address of the parameter.
 
Datatypetype
 Data-type of the parameter.
 
uint4 flags
 Lock and other properties from ParameterPieces flags.
 

Detailed Description

A stand-alone parameter with no backing symbol.

Name, data-type, and storage location is stored internally to the object. This is suitable for return values, function pointer prototypes, or functions that haven't been fully analyzed.

Member Function Documentation

◆ clone()

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

Clone the parameter.

Implements ghidra::ProtoParameter.

References addr, flags, name, and type.

◆ getAddress()

virtual Address ghidra::ParameterBasic::getAddress ( void  ) const
inlinevirtual

Get the storage address for this parameter.

Implements ghidra::ProtoParameter.

References addr.

◆ getName()

virtual const string & ghidra::ParameterBasic::getName ( void  ) const
inlinevirtual

Get the name of the parameter ("" for return value)

Implements ghidra::ProtoParameter.

References name.

◆ getSize()

virtual int4 ghidra::ParameterBasic::getSize ( void  ) const
inlinevirtual

Get the number of bytes occupied by this parameter.

Implements ghidra::ProtoParameter.

References ghidra::Datatype::getSize(), and type.

◆ getSymbol()

virtual Symbol * ghidra::ParameterBasic::getSymbol ( void  ) const
inlinevirtual

Retrieve the formal Symbol associated with this parameter.

If there is no backing symbol an exception is thrown

Returns
the backing Symbol object

Implements ghidra::ProtoParameter.

◆ getType()

virtual Datatype * ghidra::ParameterBasic::getType ( void  ) const
inlinevirtual

Get the data-type associate with this.

Implements ghidra::ProtoParameter.

References type.

◆ isHiddenReturn()

virtual bool ghidra::ParameterBasic::isHiddenReturn ( void  ) const
inlinevirtual

Is this a pointer to storage for a return value.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::hiddenretparm.

◆ isIndirectStorage()

virtual bool ghidra::ParameterBasic::isIndirectStorage ( void  ) const
inlinevirtual

Is this really a pointer to the true parameter.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::indirectstorage.

◆ isNameLocked()

virtual bool ghidra::ParameterBasic::isNameLocked ( void  ) const
inlinevirtual

Is the parameter name locked.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::namelock.

◆ isNameUndefined()

virtual bool ghidra::ParameterBasic::isNameUndefined ( void  ) const
inlinevirtual

Is the name of this parameter undefined.

Implements ghidra::ProtoParameter.

References name.

◆ isSizeTypeLocked()

virtual bool ghidra::ParameterBasic::isSizeTypeLocked ( void  ) const
inlinevirtual

Is the size of the parameter locked.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::sizelock.

Referenced by overrideSizeLockType().

◆ isThisPointer()

virtual bool ghidra::ParameterBasic::isThisPointer ( void  ) const
inlinevirtual

Is this the "this" pointer for a class method.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::isthis.

◆ isTypeLocked()

virtual bool ghidra::ParameterBasic::isTypeLocked ( void  ) const
inlinevirtual

Is the parameter data-type locked.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::typelock.

◆ overrideSizeLockType()

void ghidra::ParameterBasic::overrideSizeLockType ( Datatype ct)
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

Implements ghidra::ProtoParameter.

References ghidra::Datatype::getSize(), isSizeTypeLocked(), and type.

◆ resetSizeLockType()

void ghidra::ParameterBasic::resetSizeLockType ( TypeFactory factory)
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

Implements ghidra::ProtoParameter.

References ghidra::TypeFactory::getBase(), ghidra::Datatype::getMetatype(), ghidra::Datatype::getSize(), type, and ghidra::TYPE_UNKNOWN.

◆ setNameLock()

void ghidra::ParameterBasic::setNameLock ( bool  val)
virtual

Toggle the lock on the name.

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::namelock.

◆ setThisPointer()

void ghidra::ParameterBasic::setThisPointer ( bool  val)
virtual

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

Implements ghidra::ProtoParameter.

References flags, and ghidra::ParameterPieces::isthis.

◆ setTypeLock()

void ghidra::ParameterBasic::setTypeLock ( bool  val)
virtual

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