Package ghidra.app.util.demangler
Class AbstractDemangledFunctionDefinitionDataType
- java.lang.Object
-
- ghidra.app.util.demangler.DemangledType
-
- ghidra.app.util.demangler.DemangledDataType
-
- ghidra.app.util.demangler.AbstractDemangledFunctionDefinitionDataType
-
- All Implemented Interfaces:
Demangled
- Direct Known Subclasses:
DemangledFunctionIndirect
,DemangledFunctionPointer
,DemangledFunctionReference
public abstract class AbstractDemangledFunctionDefinitionDataType extends DemangledDataType
Parent base class for types that represent things that refer to functions
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
callingConvention
protected static java.lang.String
DEFAULT_NAME_PREFIX
protected static java.lang.String
EMPTY_STRING
protected static int
ID
protected boolean
isConstPointer
protected boolean
isTrailingPointer64
protected boolean
isTrailingRestrict
protected boolean
isTrailingUnaligned
protected java.lang.String
modifier
protected java.util.List<DemangledDataType>
parameters
protected java.lang.String
parentName
protected DemangledDataType
returnType
-
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
mangled, namespace, template
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addFunctionPointerParens(java.lang.StringBuilder buffer, java.lang.String s)
void
addParameter(DemangledDataType parameter)
Adds a parameters to the end of the parameter list for this demangled functionprotected void
addParentName(java.lang.StringBuilder buffer)
java.lang.String
getCallingConvention()
Returns the calling convention or null, if unspecifiedprotected java.lang.String
getConventionPointerNameString(java.lang.String name)
DataType
getDataType(DataTypeManager dataTypeManager)
Converts this demangled datatype into the corresponding Ghidra datatypejava.util.List<DemangledDataType>
getParameters()
Returns a list of the parameters for this demangled functions.DemangledDataType
getReturnType()
Returns the return typejava.lang.String
getSignature()
Generates a complete representation of this object to include all know attributes of this objectprotected abstract java.lang.String
getTypeString()
Returns the string for this type of reference (e.g., * or &)boolean
isConstPointer()
boolean
isTrailingPointer64()
boolean
isTrailingRestrict()
boolean
isTrailingUnaligned()
void
setCallingConvention(java.lang.String callingConvention)
Sets the function calling convention.void
setConstPointer()
void
setModifier(java.lang.String modifier)
Sets the function __ modifier.void
setReturnType(DemangledDataType returnType)
Sets the return typevoid
setTrailingPointer64()
void
setTrailingRestrict()
void
setTrailingUnaligned()
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, setRValueReference, setSigned, setStruct, setTemplate, setUnaligned, setUnion, setUnsigned, setVarArgs, toString
-
Methods inherited from class ghidra.app.util.demangler.DemangledType
getDemangledName, getMangledString, getName, getNamespace, getNamespaceName, getNamespaceString, getOriginalDemangled, getTemplate, isConst, isVolatile, setConst, setName, setNamespace, setTemplate, setVolatile
-
-
-
-
Field Detail
-
DEFAULT_NAME_PREFIX
protected static final java.lang.String DEFAULT_NAME_PREFIX
- See Also:
- Constant Field Values
-
EMPTY_STRING
protected static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
-
ID
protected static int ID
-
returnType
protected DemangledDataType returnType
-
callingConvention
protected java.lang.String callingConvention
-
parameters
protected java.util.List<DemangledDataType> parameters
-
modifier
protected java.lang.String modifier
-
isConstPointer
protected boolean isConstPointer
-
parentName
protected java.lang.String parentName
-
isTrailingPointer64
protected boolean isTrailingPointer64
-
isTrailingUnaligned
protected boolean isTrailingUnaligned
-
isTrailingRestrict
protected boolean isTrailingRestrict
-
-
Method Detail
-
getTypeString
protected abstract java.lang.String getTypeString()
Returns the string for this type of reference (e.g., * or &)- Returns:
- the string
-
getSignature
public java.lang.String getSignature()
Description copied from interface:Demangled
Generates a complete representation of this object to include all know attributes of this object- Specified by:
getSignature
in interfaceDemangled
- Overrides:
getSignature
in classDemangledDataType
- Returns:
- the signature
-
setReturnType
public void setReturnType(DemangledDataType returnType)
Sets the return type- Parameters:
returnType
- the return type
-
getReturnType
public DemangledDataType getReturnType()
Returns the return type- Returns:
- the return type
-
setCallingConvention
public void setCallingConvention(java.lang.String callingConvention)
Sets the function calling convention. For example, "__cdecl"- Parameters:
callingConvention
- the function calling convention
-
getCallingConvention
public java.lang.String getCallingConvention()
Returns the calling convention or null, if unspecified- Returns:
- the calling convention or null, if unspecified
-
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()
-
addParameter
public void addParameter(DemangledDataType parameter)
Adds a parameters to the end of the parameter list for this demangled function- Parameters:
parameter
- the new parameter to add
-
getParameters
public java.util.List<DemangledDataType> getParameters()
Returns a list of the parameters for this demangled functions.- Returns:
- a list of the parameters for this demangled functions
-
toSignature
public java.lang.String toSignature(java.lang.String name)
-
getConventionPointerNameString
protected java.lang.String getConventionPointerNameString(java.lang.String name)
-
addFunctionPointerParens
protected void addFunctionPointerParens(java.lang.StringBuilder buffer, java.lang.String s)
-
addParentName
protected void addParentName(java.lang.StringBuilder buffer)
-
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 manager to search and whose data organization should be used- Returns:
- the Ghidra datatype corresponding to the demangled datatype
-
-