SIDE_TYPE_S32,
SIDE_TYPE_S64,
SIDE_TYPE_BYTE,
- SIDE_TYPE_POINTER,
+ SIDE_TYPE_POINTER32,
+ SIDE_TYPE_POINTER64,
SIDE_TYPE_FLOAT_BINARY16,
SIDE_TYPE_FLOAT_BINARY32,
SIDE_TYPE_FLOAT_BINARY64,
SIDE_TYPE_ARRAY_S32,
SIDE_TYPE_ARRAY_S64,
SIDE_TYPE_ARRAY_BYTE,
- SIDE_TYPE_ARRAY_POINTER,
+ SIDE_TYPE_ARRAY_POINTER32,
+ SIDE_TYPE_ARRAY_POINTER64,
SIDE_TYPE_VLA_U8,
SIDE_TYPE_VLA_U16,
SIDE_TYPE_VLA_S32,
SIDE_TYPE_VLA_S64,
SIDE_TYPE_VLA_BYTE,
- SIDE_TYPE_VLA_POINTER,
+ SIDE_TYPE_VLA_POINTER32,
+ SIDE_TYPE_VLA_POINTER64,
/* Enumeration types */
SIDE_TYPE_ENUM,
SIDE_DYNAMIC_TYPE_S32,
SIDE_DYNAMIC_TYPE_S64,
SIDE_DYNAMIC_TYPE_BYTE,
- SIDE_DYNAMIC_TYPE_POINTER,
+ SIDE_DYNAMIC_TYPE_POINTER32,
+ SIDE_DYNAMIC_TYPE_POINTER64,
SIDE_DYNAMIC_TYPE_FLOAT_BINARY16,
SIDE_DYNAMIC_TYPE_FLOAT_BINARY32,
SIDE_DYNAMIC_TYPE_FLOAT_BINARY64,
SIDE_ATTR_TYPE_S16,
SIDE_ATTR_TYPE_S32,
SIDE_ATTR_TYPE_S64,
- SIDE_ATTR_TYPE_POINTER,
+ SIDE_ATTR_TYPE_POINTER32,
+ SIDE_ATTR_TYPE_POINTER64,
SIDE_ATTR_TYPE_FLOAT_BINARY16,
SIDE_ATTR_TYPE_FLOAT_BINARY32,
SIDE_ATTR_TYPE_FLOAT_BINARY64,
int16_t side_s16;
int32_t side_s32;
int64_t side_s64;
- uintptr_t side_pointer;
#if __HAVE_FLOAT16
_Float16 side_float_binary16;
#endif
int32_t side_s32;
int64_t side_s64;
uint8_t side_byte;
- uintptr_t side_pointer;
#if __HAVE_FLOAT16
_Float16 side_float_binary16;
#endif
int32_t side_s32;
int64_t side_s64;
uint8_t side_byte;
- uintptr_t side_pointer;
#if __HAVE_FLOAT16
_Float16 side_float_binary16;
#endif
/* Event and type attributes */
+#if SIDE_BITS_PER_LONG == 64
+# define SIDE_TYPE_POINTER_HOST SIDE_TYPE_POINTER64
+# define SIDE_TYPE_ARRAY_POINTER_HOST SIDE_TYPE_ARRAY_POINTER64
+# define SIDE_TYPE_VLA_POINTER_HOST SIDE_TYPE_VLA_POINTER64
+# define SIDE_DYNAMIC_TYPE_POINTER_HOST SIDE_DYNAMIC_TYPE_POINTER64
+# define SIDE_ATTR_TYPE_POINTER_HOST SIDE_ATTR_TYPE_POINTER64
+# define SIDE_PTR_HOST .side_u64
+#else
+# define SIDE_TYPE_POINTER_HOST SIDE_TYPE_POINTER32
+# define SIDE_TYPE_ARRAY_POINTER_HOST SIDE_TYPE_ARRAY_POINTER32
+# define SIDE_TYPE_VLA_POINTER_HOST SIDE_TYPE_VLA_POINTER32
+# define SIDE_DYNAMIC_TYPE_POINTER_HOST SIDE_DYNAMIC_TYPE_POINTER32
+# define SIDE_ATTR_TYPE_POINTER_HOST SIDE_ATTR_TYPE_POINTER32
+# define SIDE_PTR_HOST .side_u32
+#endif
+
#define side_attr(_key, _value) \
{ \
.key = _key, \
#define side_attr_s16(_val) { .type = SIDE_ATTR_TYPE_S16, .u = { .side_s16 = (_val) } }
#define side_attr_s32(_val) { .type = SIDE_ATTR_TYPE_S32, .u = { .side_s32 = (_val) } }
#define side_attr_s64(_val) { .type = SIDE_ATTR_TYPE_S64, .u = { .side_s64 = (_val) } }
-#define side_attr_pointer(_val) { .type = SIDE_ATTR_TYPE_POINTER, .u = { .side_pointer = (uintptr_t) (_val) } }
+#define side_attr_pointer(_val) { .type = SIDE_ATTR_TYPE_POINTER_HOST, .u = { SIDE_PTR_HOST = (uintptr_t) (_val) } }
#define side_attr_float_binary16(_val) { .type = SIDE_ATTR_TYPE_FLOAT_BINARY16, .u = { .side_float_binary16 = (_val) } }
#define side_attr_float_binary32(_val) { .type = SIDE_ATTR_TYPE_FLOAT_BINARY32, .u = { .side_float_binary32 = (_val) } }
#define side_attr_float_binary64(_val) { .type = SIDE_ATTR_TYPE_FLOAT_BINARY64, .u = { .side_float_binary64 = (_val) } }
#define side_type_s32(_attr) _side_type_basic(SIDE_TYPE_S32, SIDE_TYPE_BYTE_ORDER_HOST, SIDE_PARAM(_attr))
#define side_type_s64(_attr) _side_type_basic(SIDE_TYPE_S64, SIDE_TYPE_BYTE_ORDER_HOST, SIDE_PARAM(_attr))
#define side_type_byte(_attr) _side_type_basic(SIDE_TYPE_BYTE, SIDE_TYPE_BYTE_ORDER_HOST, SIDE_PARAM(_attr))
-#define side_type_pointer(_attr) _side_type_basic(SIDE_TYPE_POINTER, SIDE_TYPE_BYTE_ORDER_HOST, SIDE_PARAM(_attr))
+#define side_type_pointer(_attr) _side_type_basic(SIDE_TYPE_POINTER_HOST, SIDE_TYPE_BYTE_ORDER_HOST, SIDE_PARAM(_attr))
#define side_type_float_binary16(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY16, SIDE_TYPE_FLOAT_WORD_ORDER_HOST, SIDE_PARAM(_attr))
#define side_type_float_binary32(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY32, SIDE_TYPE_FLOAT_WORD_ORDER_HOST, SIDE_PARAM(_attr))
#define side_type_float_binary64(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY64, SIDE_TYPE_FLOAT_WORD_ORDER_HOST, SIDE_PARAM(_attr))
#define side_type_s16_le(_attr) _side_type_basic(SIDE_TYPE_S16, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
#define side_type_s32_le(_attr) _side_type_basic(SIDE_TYPE_S32, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
#define side_type_s64_le(_attr) _side_type_basic(SIDE_TYPE_S64, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
-#define side_type_pointer_le(_attr) _side_type_basic(SIDE_TYPE_POINTER, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
+#define side_type_pointer_le(_attr) _side_type_basic(SIDE_TYPE_POINTER_HOST, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
#define side_type_float_binary16_le(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY16, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
#define side_type_float_binary32_le(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY32, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
#define side_type_float_binary64_le(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY64, SIDE_TYPE_BYTE_ORDER_LE, SIDE_PARAM(_attr))
#define side_type_s16_be(_attr) _side_type_basic(SIDE_TYPE_S16, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
#define side_type_s32_be(_attr) _side_type_basic(SIDE_TYPE_S32, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
#define side_type_s64_be(_attr) _side_type_basic(SIDE_TYPE_S64, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
-#define side_type_pointer_be(_attr) _side_type_basic(SIDE_TYPE_POINTER, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
+#define side_type_pointer_be(_attr) _side_type_basic(SIDE_TYPE_POINTER_HOST, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
#define side_type_float_binary16_be(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY16, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
#define side_type_float_binary32_be(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY32, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
#define side_type_float_binary64_be(_attr) _side_type_basic(SIDE_TYPE_FLOAT_BINARY64, SIDE_TYPE_BYTE_ORDER_BE, SIDE_PARAM(_attr))
#define side_arg_s32(_val) { .type = SIDE_TYPE_S32, .u = { .side_s32 = (_val) } }
#define side_arg_s64(_val) { .type = SIDE_TYPE_S64, .u = { .side_s64 = (_val) } }
#define side_arg_byte(_val) { .type = SIDE_TYPE_BYTE, .u = { .side_byte = (_val) } }
-#define side_arg_pointer(_val) { .type = SIDE_TYPE_POINTER, .u = { .side_pointer = (uintptr_t) (_val) } }
+#define side_arg_pointer(_val) { .type = SIDE_TYPE_POINTER_HOST, .u = { SIDE_PTR_HOST = (uintptr_t) (_val) } }
#define side_arg_enum_bitmap8(_val) { .type = SIDE_TYPE_ENUM_BITMAP8, .u = { .side_u8 = (_val) } }
#define side_arg_enum_bitmap16(_val) { .type = SIDE_TYPE_ENUM_BITMAP16, .u = { .side_u16 = (_val) } }
#define side_arg_enum_bitmap32(_val) { .type = SIDE_TYPE_ENUM_BITMAP32, .u = { .side_u32 = (_val) } }
#define side_arg_array_s32(_ptr) { .type = SIDE_TYPE_ARRAY_S32, .u = { .side_array_fixint = (_ptr) } }
#define side_arg_array_s64(_ptr) { .type = SIDE_TYPE_ARRAY_S64, .u = { .side_array_fixint = (_ptr) } }
#define side_arg_array_byte(_ptr) { .type = SIDE_TYPE_ARRAY_BYTE, .u = { .side_array_fixint = (_ptr) } }
-#define side_arg_array_pointer(_ptr) { .type = SIDE_TYPE_ARRAY_POINTER, .u = { .side_array_fixint = (_ptr) } }
+#define side_arg_array_pointer(_ptr) { .type = SIDE_TYPE_ARRAY_POINTER_HOST, .u = { .side_array_fixint = (_ptr) } }
#define side_arg_vla_u8(_ptr, _length) { .type = SIDE_TYPE_VLA_U8, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } }
#define side_arg_vla_u16(_ptr, _length) { .type = SIDE_TYPE_VLA_U16, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } } }
#define side_arg_vla_s32(_ptr, _length) { .type = SIDE_TYPE_VLA_S32, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } } }
#define side_arg_vla_s64(_ptr, _length) { .type = SIDE_TYPE_VLA_S64, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } } }
#define side_arg_vla_byte(_ptr, _length) { .type = SIDE_TYPE_VLA_BYTE, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } } }
-#define side_arg_vla_pointer(_ptr, _length) { .type = SIDE_TYPE_VLA_POINTER, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } } }
+#define side_arg_vla_pointer(_ptr, _length) { .type = SIDE_TYPE_VLA_POINTER_HOST, .u = { .side_vla_fixint = { .p = (_ptr), .length = (_length) } } }
#define side_arg_dynamic(_dynamic_arg_type) \
{ \
}
#define _side_arg_dynamic_pointer(_val, _byte_order, _attr) \
{ \
- .dynamic_type = SIDE_DYNAMIC_TYPE_POINTER, \
+ .dynamic_type = SIDE_DYNAMIC_TYPE_POINTER_HOST, \
.u = { \
.side_basic = { \
.attr = _attr, \
.nr_attr = SIDE_ARRAY_SIZE(SIDE_PARAM(_attr)), \
.byte_order = _byte_order, \
.u = { \
- .side_pointer = (uintptr_t) (_val), \
+ SIDE_PTR_HOST = (uintptr_t) (_val), \
}, \
}, \
}, \
case SIDE_TYPE_S16:
case SIDE_TYPE_S32:
case SIDE_TYPE_S64:
- case SIDE_TYPE_POINTER:
+ case SIDE_TYPE_POINTER32:
+ case SIDE_TYPE_POINTER64:
if (type_desc->u.side_basic.byte_order != SIDE_TYPE_BYTE_ORDER_HOST)
return true;
else
case SIDE_DYNAMIC_TYPE_S16:
case SIDE_DYNAMIC_TYPE_S32:
case SIDE_DYNAMIC_TYPE_S64:
- case SIDE_DYNAMIC_TYPE_POINTER:
+ case SIDE_DYNAMIC_TYPE_POINTER32:
+ case SIDE_DYNAMIC_TYPE_POINTER64:
if (item->u.side_basic.byte_order != SIDE_TYPE_BYTE_ORDER_HOST)
return true;
else
case SIDE_ATTR_TYPE_S64:
printf("%" PRId64, attr->value.u.side_s64);
break;
- case SIDE_ATTR_TYPE_POINTER:
- printf("0x%" PRIxPTR, attr->value.u.side_pointer);
+ case SIDE_ATTR_TYPE_POINTER32:
+ printf("0x%" PRIx32, attr->value.u.side_u32);
+ break;
+ case SIDE_ATTR_TYPE_POINTER64:
+ printf("0x%" PRIx64, attr->value.u.side_u64);
break;
case SIDE_ATTR_TYPE_FLOAT_BINARY16:
#if __HAVE_FLOAT16
case SIDE_TYPE_ARRAY_S16:
case SIDE_TYPE_ARRAY_S32:
case SIDE_TYPE_ARRAY_S64:
- case SIDE_TYPE_ARRAY_POINTER:
+ case SIDE_TYPE_ARRAY_POINTER32:
+ case SIDE_TYPE_ARRAY_POINTER64:
case SIDE_TYPE_ARRAY_BYTE:
case SIDE_TYPE_ARRAY:
break;
case SIDE_TYPE_VLA_S32:
case SIDE_TYPE_VLA_S64:
case SIDE_TYPE_VLA_BYTE:
- case SIDE_TYPE_VLA_POINTER:
+ case SIDE_TYPE_VLA_POINTER32:
+ case SIDE_TYPE_VLA_POINTER64:
case SIDE_TYPE_VLA:
break;
default:
printf("%" PRId64, v);
break;
}
- case SIDE_TYPE_POINTER:
+ case SIDE_TYPE_POINTER32:
{
- uintptr_t v;
+ uint32_t v;
- v = item->u.side_pointer;
+ v = item->u.side_u32;
if (type_to_host_reverse_bo(type_desc))
- v = side_bswap_pointer(v);
+ v = side_bswap_32(v);
tracer_print_basic_type_header(type_desc);
- printf("0x%" PRIxPTR, v);
+ printf("0x%" PRIx32, v);
+ break;
+ }
+ case SIDE_TYPE_POINTER64:
+ {
+ uint64_t v;
+
+ v = item->u.side_u64;
+ if (type_to_host_reverse_bo(type_desc))
+ v = side_bswap_64(v);
+ tracer_print_basic_type_header(type_desc);
+ printf("0x%" PRIx64, v);
break;
}
case SIDE_TYPE_BYTE:
case SIDE_TYPE_ARRAY_S32:
case SIDE_TYPE_ARRAY_S64:
case SIDE_TYPE_ARRAY_BYTE:
- case SIDE_TYPE_ARRAY_POINTER:
+ case SIDE_TYPE_ARRAY_POINTER32:
+ case SIDE_TYPE_ARRAY_POINTER64:
tracer_print_array_fixint(type_desc, item);
break;
case SIDE_TYPE_VLA_U8:
case SIDE_TYPE_VLA_S32:
case SIDE_TYPE_VLA_S64:
case SIDE_TYPE_VLA_BYTE:
- case SIDE_TYPE_VLA_POINTER:
+ case SIDE_TYPE_VLA_POINTER32:
+ case SIDE_TYPE_VLA_POINTER64:
tracer_print_vla_fixint(type_desc, item);
break;
case SIDE_TYPE_DYNAMIC:
if (elem_type->type != SIDE_TYPE_BYTE)
goto type_error;
break;
- case SIDE_TYPE_ARRAY_POINTER:
- if (elem_type->type != SIDE_TYPE_POINTER)
+ case SIDE_TYPE_ARRAY_POINTER32:
+ if (elem_type->type != SIDE_TYPE_POINTER32)
+ goto type_error;
+ case SIDE_TYPE_ARRAY_POINTER64:
+ if (elem_type->type != SIDE_TYPE_POINTER64)
goto type_error;
break;
default:
case SIDE_TYPE_BYTE:
sav_elem.u.side_byte = ((const uint8_t *) p)[i];
break;
- case SIDE_TYPE_POINTER:
- sav_elem.u.side_pointer = ((const uintptr_t *) p)[i];
+ case SIDE_TYPE_POINTER32:
+ sav_elem.u.side_u32 = ((const uint32_t *) p)[i];
+ break;
+ case SIDE_TYPE_POINTER64:
+ sav_elem.u.side_u64 = ((const uint64_t *) p)[i];
break;
default:
if (elem_type->type != SIDE_TYPE_BYTE)
goto type_error;
break;
- case SIDE_TYPE_VLA_POINTER:
- if (elem_type->type != SIDE_TYPE_POINTER)
+ case SIDE_TYPE_VLA_POINTER32:
+ if (elem_type->type != SIDE_TYPE_POINTER32)
+ goto type_error;
+ case SIDE_TYPE_VLA_POINTER64:
+ if (elem_type->type != SIDE_TYPE_POINTER64)
goto type_error;
break;
default:
case SIDE_TYPE_BYTE:
sav_elem.u.side_byte = ((const uint8_t *) p)[i];
break;
- case SIDE_TYPE_POINTER:
- sav_elem.u.side_pointer = ((const uintptr_t *) p)[i];
+ case SIDE_TYPE_POINTER32:
+ sav_elem.u.side_u32 = ((const uint32_t *) p)[i];
+ break;
+ case SIDE_TYPE_POINTER64:
+ sav_elem.u.side_u64 = ((const uint64_t *) p)[i];
break;
default:
tracer_print_dynamic_basic_type_header(item);
printf("0x%" PRIx8, item->u.side_basic.u.side_byte);
break;
- case SIDE_DYNAMIC_TYPE_POINTER:
+ case SIDE_DYNAMIC_TYPE_POINTER32:
{
- uintptr_t v;
+ uint32_t v;
- v = item->u.side_basic.u.side_pointer;
+ v = item->u.side_basic.u.side_u32;
if (dynamic_type_to_host_reverse_bo(item))
- v = side_bswap_pointer(v);
+ v = side_bswap_32(v);
+ tracer_print_dynamic_basic_type_header(item);
+ printf("0x%" PRIx32, v);
+ break;
+ }
+
+ case SIDE_DYNAMIC_TYPE_POINTER64:
+ {
+ uint64_t v;
+
+ v = item->u.side_basic.u.side_u64;
+ if (dynamic_type_to_host_reverse_bo(item))
+ v = side_bswap_64(v);
tracer_print_dynamic_basic_type_header(item);
- printf("0x%" PRIxPTR, v);
+ printf("0x%" PRIx64, v);
break;
}