g_string_append_c(ctx->tsdl, '\n');
}
+static
+void append_bool_field_class(struct ctx *ctx,
+ __attribute__((unused)) struct fs_sink_ctf_field_class_bool *fc)
+{
+ /*
+ * CTF 1.8 has no boolean field class type, so this component
+ * translates it to an 8-bit unsigned integer field class.
+ */
+ append_integer_field_class_from_props(ctx, fc->base.size,
+ fc->base.base.alignment, false,
+ BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL,
+ NULL, NULL, false);
+}
+
static
void append_integer_field_class(struct ctx *ctx,
struct fs_sink_ctf_field_class_int *fc)
for (i = 0; i < bt_field_class_enumeration_get_mapping_count(ir_fc); i++) {
const char *label;
const bt_field_class_enumeration_mapping *mapping;
- const bt_field_class_unsigned_enumeration_mapping *u_mapping;
- const bt_field_class_signed_enumeration_mapping *s_mapping;
+ const bt_field_class_enumeration_unsigned_mapping *u_mapping;
+ const bt_field_class_enumeration_signed_mapping *s_mapping;
const bt_integer_range_set *ranges;
const bt_integer_range_set_unsigned *u_ranges;
const bt_integer_range_set_signed *s_ranges;
uint64_t range_i;
if (is_signed) {
- s_mapping = bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
+ s_mapping = bt_field_class_enumeration_signed_borrow_mapping_by_index_const(
ir_fc, i);
- mapping = bt_field_class_signed_enumeration_mapping_as_mapping_const(
+ mapping = bt_field_class_enumeration_signed_mapping_as_mapping_const(
s_mapping);
- s_ranges = bt_field_class_signed_enumeration_mapping_borrow_ranges_const(
+ s_ranges = bt_field_class_enumeration_signed_mapping_borrow_ranges_const(
s_mapping);
ranges = bt_integer_range_set_signed_as_range_set_const(
s_ranges);
} else {
- u_mapping = bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
+ u_mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const(
ir_fc, i);
- mapping = bt_field_class_unsigned_enumeration_mapping_as_mapping_const(
+ mapping = bt_field_class_enumeration_unsigned_mapping_as_mapping_const(
u_mapping);
- u_ranges = bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const(
+ u_ranges = bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const(
u_mapping);
ranges = bt_integer_range_set_unsigned_as_range_set_const(
u_ranges);
g_string_append_printf(ctx->tsdl, " %s;\n",
var_fc->tag_ref->str);
}
+ } else if (fc->type == FS_SINK_CTF_FIELD_CLASS_TYPE_BOOL) {
+ append_indent(ctx);
+ g_string_append(ctx->tsdl,
+ "/* The integer field class below was a trace IR boolean field class. */\n");
}
append_indent(ctx);
void append_field_class(struct ctx *ctx, struct fs_sink_ctf_field_class *fc)
{
switch (fc->type) {
+ case FS_SINK_CTF_FIELD_CLASS_TYPE_BOOL:
+ append_bool_field_class(ctx, (void *) fc);
+ break;
case FS_SINK_CTF_FIELD_CLASS_TYPE_INT:
append_integer_field_class(ctx, (void *) fc);
break;
switch (bt_value_get_type(val)) {
case BT_VALUE_TYPE_SIGNED_INTEGER:
g_string_append_printf(tsdl, "%" PRId64,
- bt_value_signed_integer_get(val));
+ bt_value_integer_signed_get(val));
break;
case BT_VALUE_TYPE_STRING:
append_quoted_string(&ctx, bt_value_string_get(val));