Package ghidra.app.util.demangler
Class DemangledFunctionPointer
- java.lang.Object
-
- ghidra.app.util.demangler.DemangledType
-
- ghidra.app.util.demangler.DemangledDataType
-
- ghidra.app.util.demangler.DemangledFunctionPointer
-
- All Implemented Interfaces:
ParameterReceiver
public class DemangledFunctionPointer extends DemangledDataType implements ParameterReceiver
A class to represent a demangled function pointer.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
callingConvention
protected boolean
isConstPointer
protected java.lang.String
modifier
-
Fields inherited from class ghidra.app.util.demangler.DemangledDataType
ARR_NOTATION, BOOL, CHAR, CLASS, COCLASS, COINTERFACE, COMPLEX, CONST, DOUBLE, ENUM, FLOAT, FLOAT128, INT, INT0_T, INT128, INT16, INT32, INT64, INT8, LONG, LONG_DOUBLE, LONG_LONG, PRIMITIVES, PTR_NOTATION, PTR64, REF_NOTATION, RESTRICT, SHORT, SIGNED, SPACE, STRING, STRUCT, UNALIGNED, UNDEFINED, UNION, UNSIGNED, VARARGS, VOID, VOLATILE, WCHAR_T
-
Fields inherited from class ghidra.app.util.demangler.DemangledType
namespace, originalMangled, template
-
-
Constructor Summary
Constructors Constructor Description DemangledFunctionPointer()
Constructs a new demangled function pointer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameter(DemangledDataType parameter)
Adds a parameters to the end of the parameter list for this demangled function.DemangledDataType
copy()
protected void
copy(DemangledDataType source, DemangledDataType destination)
java.lang.String
getCallingConvention()
Returns the calling convention or null, if unspecified.DataType
getDataType(DataTypeManager dataTypeManager)
Converts this demangled datatype into the corresponding Ghidra datatype.java.util.List<DemangledDataType>
getParameters()
Returns a list of the parameters for this demangled functions.DemangledDataType
getReturnType()
Returns the return type.boolean
isConstPointer()
boolean
isTrailingPointer64()
boolean
isTrailingRestrict()
boolean
isTrailingUnaligned()
void
setCallingConvention(java.lang.String callingConvention)
Sets the function calling convention.void
setConstPointer()
void
setDisplayFunctionPointerParens(boolean b)
void
setModifier(java.lang.String modifier)
Sets the function __ modifier.void
setReturnType(DemangledDataType returnType)
Sets the return type.void
setTrailingPointer64()
void
setTrailingRestrict()
void
setTrailingUnaligned()
java.lang.String
toSignature()
java.lang.String
toSignature(java.lang.String name)
-
Methods inherited from class ghidra.app.util.demangler.DemangledDataType
getArrayDimensions, getBasedName, getMemberScope, getPointerLevels, incrementPointerLevels, isArray, isClass, isCoclass, isCointerface, isComplex, isEnum, isPointer, isPointer64, isPrimitive, isReference, isRestrict, isSigned, isStruct, isTemplate, isUnaligned, isUnion, isUnsigned, isVarArgs, isVoid, setArray, setBasedName, setClass, setCoclass, setCointerface, setComplex, setEnum, setEnumType, setEnumType, setMemberScope, setPointer64, setReference, setRestrict, setSigned, setStruct, setTemplate, setUnaligned, setUnion, setUnsigned, setVarArgs, toString
-
Methods inherited from class ghidra.app.util.demangler.DemangledType
convertToNamespace, getDemangledName, getName, getNamespace, getOriginalMangled, getTemplate, isConst, isFunction, isVolatile, setConst, setName, setNamespace, setOriginalMangled, setTemplate, setVolatile, toNamespace
-
-
-
-
Method Detail
-
getReturnType
public DemangledDataType getReturnType()
Returns the return type.- Returns:
- the return type
-
setReturnType
public void setReturnType(DemangledDataType returnType)
Sets the return type.- Parameters:
returnType
- the return type
-
getCallingConvention
public java.lang.String getCallingConvention()
Returns the calling convention or null, if unspecified.- Returns:
- the calling convention or null, if unspecified
-
setCallingConvention
public void setCallingConvention(java.lang.String callingConvention)
Sets the function calling convention. For example, "__cdecl".- Parameters:
callingConvention
- the function calling convention
-
setModifier
public void setModifier(java.lang.String modifier)
Sets the function __ modifier. For example, "namespace::".- Parameters:
modifier
- the function modifier
-
isConstPointer
public boolean isConstPointer()
-
setConstPointer
public void setConstPointer()
-
isTrailingPointer64
public boolean isTrailingPointer64()
-
setTrailingPointer64
public void setTrailingPointer64()
-
isTrailingUnaligned
public boolean isTrailingUnaligned()
-
setTrailingUnaligned
public void setTrailingUnaligned()
-
isTrailingRestrict
public boolean isTrailingRestrict()
-
setTrailingRestrict
public void setTrailingRestrict()
-
setDisplayFunctionPointerParens
public void setDisplayFunctionPointerParens(boolean b)
-
addParameter
public void addParameter(DemangledDataType parameter)
Adds a parameters to the end of the parameter list for this demangled function.- Specified by:
addParameter
in interfaceParameterReceiver
- Parameters:
parameter
- the new parameter to add
-
getParameters
public java.util.List<DemangledDataType> getParameters()
Returns a list of the parameters for this demangled functions.- Specified by:
getParameters
in interfaceParameterReceiver
- Returns:
- a list of the parameters for this demangled functions
-
copy
public DemangledDataType copy()
- Overrides:
copy
in classDemangledDataType
-
copy
protected void copy(DemangledDataType source, DemangledDataType destination)
- Overrides:
copy
in classDemangledDataType
-
toSignature
public java.lang.String toSignature()
- Overrides:
toSignature
in classDemangledDataType
-
toSignature
public java.lang.String toSignature(java.lang.String name)
-
getDataType
public DataType getDataType(DataTypeManager dataTypeManager)
Description copied from class:DemangledDataType
Converts this demangled datatype into the corresponding Ghidra datatype.- Overrides:
getDataType
in classDemangledDataType
- Parameters:
dataTypeManager
- the data type manager to be searched and whose data organization should be used- Returns:
- the Ghidra datatype corresponding to the demangled datatype
-
-