support of volatile & revalue references
This commit is contained in:
+24
-22
@@ -29,31 +29,33 @@ typedef enum {
|
|||||||
PARAM_CONST = 0x00000001, ///< constant access
|
PARAM_CONST = 0x00000001, ///< constant access
|
||||||
PARAM_GLOBAL = 0x00000002, ///< global scope
|
PARAM_GLOBAL = 0x00000002, ///< global scope
|
||||||
PARAM_STATIC = 0x00000004, ///< parameter defined as static
|
PARAM_STATIC = 0x00000004, ///< parameter defined as static
|
||||||
PARAM_RETURN = 0x00000008, ///< parameter is return value of a function
|
PARAM_VOLATILE = 0x00000008,
|
||||||
PARAM_VARIABLE = 0x00000010, ///< parameter is variable inside of a function
|
PARAM_RETURN = 0x00000010, ///< parameter is return value of a function
|
||||||
|
PARAM_VARIABLE = 0x00000020, ///< parameter is variable inside of a function
|
||||||
// validity
|
// validity
|
||||||
PARAM_HAS_VALUE = 0x00000020, ///< parameter has a valid value (if not set, then value is undefined)
|
PARAM_HAS_VALUE = 0x00000040, ///< parameter has a valid value (if not set, then value is undefined)
|
||||||
PARAM_INVALID = 0x00000040, ///< library failed to dereference pointer
|
PARAM_INVALID = 0x00000080, ///< library failed to dereference pointer
|
||||||
// base types
|
// base types
|
||||||
PARAM_TYPE_POINTER = 0x00000080, ///< pointer
|
PARAM_TYPE_POINTER = 0x00000100, ///< pointer
|
||||||
PARAM_TYPE_INT = 0x00000100, ///< integer. to determine size of value, use 'size' field of parameter
|
PARAM_TYPE_INT = 0x00000200, ///< integer. to determine size of value, use 'size' field of parameter
|
||||||
PARAM_TYPE_UINT = 0x00000200, ///< unsigned integer. to determine size of value, use 'size' field of parameter
|
PARAM_TYPE_UINT = 0x00000400, ///< unsigned integer. to determine size of value, use 'size' field of parameter
|
||||||
PARAM_TYPE_FLOAT = 0x00000400, ///< float
|
PARAM_TYPE_FLOAT = 0x00000800, ///< float
|
||||||
PARAM_TYPE_BOOL = 0x00000800, ///< boolean
|
PARAM_TYPE_BOOL = 0x00001000, ///< boolean
|
||||||
PARAM_TYPE_VOID = 0x00001000, ///< void
|
PARAM_TYPE_VOID = 0x00002000, ///< void
|
||||||
PARAM_TYPE_CHAR = 0x00002000, ///< character
|
PARAM_TYPE_CHAR = 0x00004000, ///< character
|
||||||
PARAM_TYPE_UCHAR = 0x00004000, ///< unsigned character
|
PARAM_TYPE_UCHAR = 0x00008000, ///< unsigned character
|
||||||
PARAM_TYPE_REF = 0x00008000, ///< reference
|
PARAM_TYPE_REF = 0x00010000, ///< reference
|
||||||
PARAM_TYPE_STRING = 0x00010000, ///< pointer to C zero terminated string
|
PARAM_TYPE_RREF = 0x00020000, ///< rvalue reference
|
||||||
PARAM_TYPE_UNSPEC = 0x00020000, ///< variable number of arguments (... in C/C++)
|
PARAM_TYPE_STRING = 0x00040000, ///< pointer to C zero terminated string
|
||||||
|
PARAM_TYPE_UNSPEC = 0x00080000, ///< variable number of arguments (... in C/C++)
|
||||||
// complex types
|
// complex types
|
||||||
PARAM_TYPE_ARRAY = 0x00040000, ///< array
|
PARAM_TYPE_ARRAY = 0x00100000, ///< array
|
||||||
PARAM_TYPE_STRUCT = 0x00080000, ///< structure
|
PARAM_TYPE_STRUCT = 0x00200000, ///< structure
|
||||||
PARAM_TYPE_UNION = 0x00100000, ///< union
|
PARAM_TYPE_UNION = 0x00400000, ///< union
|
||||||
PARAM_TYPE_ENUM = 0x00200000, ///< enumeration
|
PARAM_TYPE_ENUM = 0x00800000, ///< enumeration
|
||||||
PARAM_TYPE_CLASS = 0x00400000, ///< class
|
PARAM_TYPE_CLASS = 0x01000000, ///< class
|
||||||
PARAM_TYPE_TYPEDEF = 0x00800000, ///< type definition
|
PARAM_TYPE_TYPEDEF = 0x02000000, ///< type definition
|
||||||
PARAM_TYPE_FUNCPTR = 0x01000000, ///< pointer to function
|
PARAM_TYPE_FUNCPTR = 0x04000000, ///< pointer to function
|
||||||
} pst_param_flags;
|
} pst_param_flags;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ static void parameter_print_type(pst_parameter* param)
|
|||||||
case PARAM_CONST:
|
case PARAM_CONST:
|
||||||
param->ctx->print(param->ctx, "%s", "const ");
|
param->ctx->print(param->ctx, "%s", "const ");
|
||||||
break;
|
break;
|
||||||
|
case PARAM_VOLATILE:
|
||||||
|
param->ctx->print(param->ctx, "%s", "volatile ");
|
||||||
|
break;
|
||||||
case PARAM_TYPE_STRUCT:
|
case PARAM_TYPE_STRUCT:
|
||||||
param->ctx->print(param->ctx, "%s", "struct ");
|
param->ctx->print(param->ctx, "%s", "struct ");
|
||||||
break;
|
break;
|
||||||
@@ -127,6 +130,9 @@ static void parameter_print_type(pst_parameter* param)
|
|||||||
case PARAM_TYPE_REF:
|
case PARAM_TYPE_REF:
|
||||||
param->ctx->print(param->ctx, "%s", "&");
|
param->ctx->print(param->ctx, "%s", "&");
|
||||||
break;
|
break;
|
||||||
|
case PARAM_TYPE_RREF:
|
||||||
|
param->ctx->print(param->ctx, "%s", "&&");
|
||||||
|
break;
|
||||||
case PARAM_TYPE_ARRAY:
|
case PARAM_TYPE_ARRAY:
|
||||||
param->ctx->print(param->ctx, "%s", "[]");
|
param->ctx->print(param->ctx, "%s", "[]");
|
||||||
break;
|
break;
|
||||||
@@ -362,7 +368,12 @@ bool parameter_handle_type(pst_parameter* param, Dwarf_Die* result)
|
|||||||
case DW_TAG_reference_type:
|
case DW_TAG_reference_type:
|
||||||
parameter_add_type(param, NULL, PARAM_TYPE_REF);
|
parameter_add_type(param, NULL, PARAM_TYPE_REF);
|
||||||
break;
|
break;
|
||||||
|
case DW_TAG_rvalue_reference_type:
|
||||||
|
parameter_add_type(param, NULL, PARAM_TYPE_RREF);
|
||||||
|
break;
|
||||||
|
case DW_TAG_volatile_type:
|
||||||
|
parameter_add_type(param, NULL, PARAM_VOLATILE);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
pst_log(SEVERITY_WARNING, "Unknown 0x%X tag type", dwarf_tag(&ret_die));
|
pst_log(SEVERITY_WARNING, "Unknown 0x%X tag type", dwarf_tag(&ret_die));
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user