Enumeration mapping iterator's initial position is inconsistent
[babeltrace.git] / lib / ctf-ir / field-types.c
index 7fcf8e2ebfe9c3f2c6245a12f6ca19cabbd0e1b2..5063ea65b87f7f8a842610d421c3923ecafb5276 100644 (file)
@@ -306,6 +306,14 @@ void destroy_enumeration_mapping(struct enumeration_mapping *mapping)
 static
 void destroy_structure_field(struct structure_field *field)
 {
+       if (!field) {
+               return;
+       }
+
+       BT_LOGD("Destroying structure/variant field type's field object: "
+               "addr=%p, field-ft-addr=%p, field-name=\"%s\"",
+               field, field->type, g_quark_to_string(field->name));
+       BT_LOGD_STR("Putting field type.");
        bt_put(field->type);
        g_free(field);
 }
@@ -397,8 +405,12 @@ void bt_ctf_field_type_init(struct bt_ctf_field_type *type, bt_bool init_bo)
        type->serialize = type_serialize_funcs[type->id];
 
        if (init_bo) {
-               int ret = bt_ctf_field_type_set_byte_order(type,
-                       BT_CTF_BYTE_ORDER_NATIVE);
+               int ret;
+               const enum bt_ctf_byte_order bo = BT_CTF_BYTE_ORDER_NATIVE;
+
+               BT_LOGD("Setting initial field type's byte order: bo=%s",
+                       bt_ctf_byte_order_string(bo));
+               ret = bt_ctf_field_type_set_byte_order(type, bo);
                assert(ret == 0);
        }
 
@@ -438,6 +450,8 @@ int add_structure_field(GPtrArray *fields,
                GUINT_TO_POINTER(name_quark),
                GUINT_TO_POINTER(fields->len));
        g_ptr_array_add(fields, field);
+       BT_LOGV("Added structure/variant field type field: field-ft-addr=%p, "
+               "field-name=\"%s\"", field_type, field_name);
 end:
        return ret;
 }
@@ -448,15 +462,10 @@ void bt_ctf_field_type_destroy(struct bt_object *obj)
        struct bt_ctf_field_type *type;
        enum bt_ctf_field_type_id type_id;
 
-       BT_LOGD("Destroying field type object: addr=%p", obj);
        type = container_of(obj, struct bt_ctf_field_type, base);
        type_id = type->id;
-       if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
-                       type_id >= BT_CTF_NR_TYPE_IDS) {
-               BT_LOGW("Unknown field type ID: addr=%p, id=%d", obj, type_id);
-               return;
-       }
-
+       assert(type_id > BT_CTF_FIELD_TYPE_ID_UNKNOWN &&
+               type_id < BT_CTF_NR_TYPE_IDS);
        type_destroy_funcs[type_id](type);
 }
 
@@ -537,7 +546,7 @@ void set_enumeration_range_overlap(
                                                && mapping[0]->range_end._signed
                                                        >= mapping[1]->range_start._signed) {
                                        enumeration_type->has_overlapping_ranges = BT_TRUE;
-                                       return;
+                                       goto end;
                                }
                        } else {
                                if (mapping[0]->range_start._unsigned
@@ -545,11 +554,18 @@ void set_enumeration_range_overlap(
                                                && mapping[0]->range_end._unsigned
                                                        >= mapping[1]->range_start._unsigned) {
                                        enumeration_type->has_overlapping_ranges = BT_TRUE;
-                                       return;
+                                       goto end;
                                }
                        }
                }
        }
+
+end:
+       if (enumeration_type->has_overlapping_ranges) {
+               BT_LOGV_STR("Enumeration field type has overlapping ranges.");
+       } else {
+               BT_LOGV_STR("Enumeration field type has no overlapping ranges.");
+       }
 }
 
 static
@@ -681,25 +697,6 @@ bt_bool bt_ctf_field_type_enumeration_has_overlapping_ranges(
        return enumeration_type->has_overlapping_ranges;
 }
 
-static
-int bt_ctf_field_type_enumeration_get_mapping_name(
-               struct bt_ctf_field_type *enum_field_type,
-               uint64_t index,
-               const char **mapping_name)
-{
-       int ret = 0;
-       struct enumeration_mapping *mapping;
-
-       assert(enum_field_type);
-       mapping = get_enumeration_mapping(enum_field_type, index);
-       assert(mapping);
-       if (mapping_name) {
-               *mapping_name = g_quark_to_string(mapping->string);
-       }
-
-       return ret;
-}
-
 static
 int bt_ctf_field_type_variant_validate(struct bt_ctf_field_type *type)
 {
@@ -710,7 +707,6 @@ int bt_ctf_field_type_variant_validate(struct bt_ctf_field_type *type)
                container_of(type, struct bt_ctf_field_type_variant,
                        parent);
        int64_t i;
-       int64_t tag_mappings_count;
 
        if (variant->tag_name->len == 0) {
                BT_LOGW("Invalid variant field type: no tag field name: "
@@ -737,43 +733,20 @@ int bt_ctf_field_type_variant_validate(struct bt_ctf_field_type *type)
                goto end;
        }
 
-       tag_mappings_count =
-               bt_ctf_field_type_enumeration_get_mapping_count(
-                       (struct bt_ctf_field_type *) variant->tag);
-
        /*
-        * Validate that each mapping found in the tag has a name which
-        * is also the name of a field in this variant field type.
+        * It is valid to have a variant field type which does not have
+        * the fields corresponding to each label in the associated
+        * enumeration.
+        *
+        * It is also valid to have variant field type fields which
+        * cannot be selected because the variant field type tag has no
+        * mapping named as such. This scenario, while not ideal, cannot
+        * cause any error.
         *
-        * The opposite is accepted: variant FT fields which cannot be
-        * selected because the variant FT tag has no mapping named as
-        * such. This scenario, while not ideal, cannot cause any error.
+        * If a non-existing field happens to be selected by an
+        * enumeration while reading a variant field, an error will be
+        * generated at that point (while reading the stream).
         */
-       for (i = 0; i < tag_mappings_count; ++i) {
-               const char *label;
-               struct bt_ctf_field_type *ft;
-
-               ret = bt_ctf_field_type_enumeration_get_mapping_name(
-                       (struct bt_ctf_field_type *) variant->tag,
-                       i, &label);
-               assert(ret == 0);
-               assert(label);
-               ft = bt_ctf_field_type_variant_get_field_type_by_name(
-                       type, label);
-               if (!ft) {
-                       BT_LOGW("Invalid variant field type: "
-                               "enumeration tag field type contains a mapping which does not name a variant field type field: "
-                               "variant-ft-addr=%p, tag-field-name=\"%s\", "
-                               "enum-ft-addr=%p, mapping-name=\"%s\"",
-                               type, variant->tag_name->str, variant->tag,
-                               label);
-                       ret = -1;
-                       goto end;
-               }
-
-               BT_PUT(ft);
-       }
-
        field_count = bt_ctf_field_type_variant_get_field_count(type);
        if (field_count < 0) {
                BT_LOGW("Invalid variant field type: no fields: "
@@ -835,6 +808,7 @@ int bt_ctf_field_type_validate(struct bt_ctf_field_type *type)
 
        if (!ret && type->frozen) {
                /* Field type is valid */
+               BT_LOGV("Marking field type as valid: addr=%p", type);
                type->valid = 1;
        }
 
@@ -956,12 +930,14 @@ int bt_ctf_field_type_integer_set_signed(struct bt_ctf_field_type *type,
 
        integer = container_of(type, struct bt_ctf_field_type_integer, parent);
        integer->is_signed = !!is_signed;
+       BT_LOGV("Set integer field type's signedness: addr=%p, is-signed=%d",
+               type, is_signed);
 end:
        return ret;
 }
 
 int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *type,
-               size_t size)
+               unsigned int size)
 {
        int ret = 0;
        struct bt_ctf_field_type_integer *integer;
@@ -996,6 +972,8 @@ int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *type,
 
        integer = container_of(type, struct bt_ctf_field_type_integer, parent);
        integer->size = size;
+       BT_LOGV("Set integer field type's size: addr=%p, size=%u",
+               type, size);
 end:
        return ret;
 }
@@ -1051,6 +1029,7 @@ int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *type,
        }
 
        switch (base) {
+       case BT_CTF_INTEGER_BASE_UNSPECIFIED:
        case BT_CTF_INTEGER_BASE_BINARY:
        case BT_CTF_INTEGER_BASE_OCTAL:
        case BT_CTF_INTEGER_BASE_DECIMAL:
@@ -1066,6 +1045,10 @@ int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *type,
                        "addr=%p, base=%d", type, base);
                ret = -1;
        }
+
+       BT_LOGV("Set integer field type's base: addr=%p, base=%s",
+               type, bt_ctf_integer_base_string(base));
+
 end:
        return ret;
 }
@@ -1131,6 +1114,8 @@ int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *type,
 
        integer = container_of(type, struct bt_ctf_field_type_integer, parent);
        integer->encoding = encoding;
+       BT_LOGV("Set integer field type's encoding: addr=%p, encoding=%s",
+               type, bt_ctf_string_encoding_string(encoding));
 end:
        return ret;
 }
@@ -1153,7 +1138,8 @@ end:
        return clock_class;
 }
 
-int bt_ctf_field_type_integer_set_mapped_clock_class(
+BT_HIDDEN
+int bt_ctf_field_type_integer_set_mapped_clock_class_no_check(
                struct bt_ctf_field_type *type,
                struct bt_ctf_clock_class *clock_class)
 {
@@ -1172,10 +1158,10 @@ int bt_ctf_field_type_integer_set_mapped_clock_class(
                goto end;
        }
 
-       if (type->frozen) {
-               BT_LOGW("Invalid parameter: field type is frozen: addr=%p",
-                       type);
-               ret = -1;
+       if (type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
+               BT_LOGW("Invalid parameter: field type is not an integer field type: "
+                       "addr=%p, ft-id=%s", type,
+                       bt_ctf_field_type_id_string(type->id));
                goto end;
        }
 
@@ -1191,6 +1177,35 @@ int bt_ctf_field_type_integer_set_mapped_clock_class(
        integer = container_of(type, struct bt_ctf_field_type_integer, parent);
        bt_put(integer->mapped_clock);
        integer->mapped_clock = bt_get(clock_class);
+       BT_LOGV("Set integer field type's mapped clock class: ft-addr=%p, "
+               "clock-class-addr=%p, clock-class-name=\"%s\"",
+               type, clock_class, bt_ctf_clock_class_get_name(clock_class));
+end:
+       return ret;
+}
+
+int bt_ctf_field_type_integer_set_mapped_clock_class(
+               struct bt_ctf_field_type *type,
+               struct bt_ctf_clock_class *clock_class)
+{
+       int ret = 0;
+
+       if (!type) {
+               BT_LOGW_STR("Invalid parameter: field type is NULL.");
+               ret = -1;
+               goto end;
+       }
+
+       if (type->frozen) {
+               BT_LOGW("Invalid parameter: field type is frozen: addr=%p",
+                       type);
+               ret = -1;
+               goto end;
+       }
+
+       ret = bt_ctf_field_type_integer_set_mapped_clock_class_no_check(
+               type, clock_class);
+
 end:
        return ret;
 }
@@ -1203,6 +1218,9 @@ void bt_ctf_field_type_enum_iter_destroy(struct bt_object *obj)
                        struct bt_ctf_field_type_enumeration_mapping_iterator,
                        base);
 
+       BT_LOGD("Destroying enumeration field type mapping iterator: addr=%p",
+               obj);
+       BT_LOGD_STR("Putting parent enumeration field type.");
        bt_put(&iter->enumeration_type->parent);
        g_free(iter);
 }
@@ -1261,16 +1279,12 @@ bt_ctf_field_type_enumeration_find_mappings_by_name(
 
        iter->u.name_quark = g_quark_try_string(name);
        if (!iter->u.name_quark) {
-               BT_LOGE("Cannot get GQuark: string=\"%s\"", name);
-               goto error;
-       }
-
-       /* Advance iterator to first entry, or leave index at -1. */
-       if (bt_ctf_field_type_enumeration_mapping_iterator_next(iter)) {
-               /* No entry found. */
-               goto error;
+               /*
+                * No results are possible, set the iterator's position at the
+                * end.
+                */
+               iter->index = iter->enumeration_type->entries->len;
        }
-
        return iter;
 error:
        bt_put(iter);
@@ -1327,6 +1341,8 @@ int bt_ctf_field_type_enumeration_mapping_iterator_next(
                        break;
                }
                default:
+                       BT_LOGF("Invalid enumeration field type mapping iterator type: "
+                               "type=%d", iter->type);
                        abort();
                }
        }
@@ -1359,13 +1375,6 @@ bt_ctf_field_type_enumeration_find_mappings_by_signed_value(
        }
 
        iter->u.signed_value = value;
-
-       /* Advance iterator to first entry, or leave index at -1. */
-       if (bt_ctf_field_type_enumeration_mapping_iterator_next(iter)) {
-               /* No entry found. */
-               goto error;
-       }
-
        return iter;
 error:
        bt_put(iter);
@@ -1376,12 +1385,7 @@ struct bt_ctf_field_type_enumeration_mapping_iterator *
 bt_ctf_field_type_enumeration_find_mappings_by_unsigned_value(
                struct bt_ctf_field_type *type, uint64_t value)
 {
-       struct bt_ctf_field_type_enumeration_mapping_iterator *iter = NULL;
-
-       if (!type) {
-               BT_LOGW_STR("Invalid parameter: field type is NULL.");
-               goto error;
-       }
+       struct bt_ctf_field_type_enumeration_mapping_iterator *iter;
 
        iter = bt_ctf_field_type_enumeration_find_mappings_type(
                        type, ITERATOR_BY_UNSIGNED_VALUE);
@@ -1399,13 +1403,6 @@ bt_ctf_field_type_enumeration_find_mappings_by_unsigned_value(
                goto error;
        }
        iter->u.unsigned_value = value;
-
-       /* Advance iterator to first entry, or leave index at -1. */
-       if (bt_ctf_field_type_enumeration_mapping_iterator_next(iter)) {
-               /* No entry found. */
-               goto error;
-       }
-
        return iter;
 error:
        bt_put(iter);
@@ -1425,6 +1422,12 @@ int bt_ctf_field_type_enumeration_mapping_iterator_get_signed(
                goto end;
        }
 
+       if (iter->index == -1) {
+               BT_LOGW_STR("Invalid enumeration field type mapping iterator access: position=-1");
+               ret = -1;
+               goto end;
+       }
+
        ret = bt_ctf_field_type_enumeration_get_mapping_signed(
                        &iter->enumeration_type->parent, iter->index,
                        mapping_name, range_begin, range_end);
@@ -1445,6 +1448,12 @@ int bt_ctf_field_type_enumeration_mapping_iterator_get_unsigned(
                goto end;
        }
 
+       if (iter->index == -1) {
+               BT_LOGW_STR("Invalid enumeration field type mapping iterator access: position=-1");
+               ret = -1;
+               goto end;
+       }
+
        ret = bt_ctf_field_type_enumeration_get_mapping_unsigned(
                        &iter->enumeration_type->parent, iter->index,
                        mapping_name, range_begin, range_end);
@@ -1475,6 +1484,7 @@ int bt_ctf_field_type_enumeration_get_mapping_signed(
 
        if (mapping_name) {
                *mapping_name = g_quark_to_string(mapping->string);
+               assert(*mapping_name);
        }
 
        if (range_begin) {
@@ -1512,6 +1522,7 @@ int bt_ctf_field_type_enumeration_get_mapping_unsigned(
 
        if (mapping_name) {
                *mapping_name = g_quark_to_string(mapping->string);
+               assert(*mapping_name);
        }
 
        if (range_begin) {
@@ -1594,7 +1605,7 @@ end:
        return container_type;
 }
 
-int bt_ctf_field_type_enumeration_add_mapping(
+int bt_ctf_field_type_enumeration_add_mapping_signed(
                struct bt_ctf_field_type *type, const char *string,
                int64_t range_start, int64_t range_end)
 {
@@ -1673,6 +1684,10 @@ int bt_ctf_field_type_enumeration_add_mapping(
        g_ptr_array_add(enumeration->entries, mapping);
        g_ptr_array_sort(enumeration->entries,
                (GCompareFunc)compare_enumeration_mappings_signed);
+       BT_LOGV("Added mapping to signed enumeration field type: addr=%p, "
+               "name=\"%s\", range-start=%" PRId64 ", "
+               "range-end=%" PRId64,
+               type, string, range_start, range_end);
 error_free:
        free(escaped_string);
 end:
@@ -1758,6 +1773,10 @@ int bt_ctf_field_type_enumeration_add_mapping_unsigned(
        g_ptr_array_add(enumeration->entries, mapping);
        g_ptr_array_sort(enumeration->entries,
                (GCompareFunc)compare_enumeration_mappings_unsigned);
+       BT_LOGV("Added mapping to unsigned enumeration field type: addr=%p, "
+               "name=\"%s\", range-start=%" PRIu64 ", "
+               "range-end=%" PRIu64,
+               type, string, range_start, range_end);
 error_free:
        free(escaped_string);
 end:
@@ -1882,6 +1901,8 @@ int bt_ctf_field_type_floating_point_set_exponent_digits(
        }
 
        floating_point->exp_dig = exponent_digits;
+       BT_LOGV("Set floating point number field type's exponent size: addr=%p, "
+               "exp-size=%u", type, exponent_digits);
 end:
        return ret;
 }
@@ -1954,6 +1975,8 @@ int bt_ctf_field_type_floating_point_set_mantissa_digits(
        }
 
        floating_point->mant_dig = mantissa_digits;
+       BT_LOGV("Set floating point number field type's mantissa size: addr=%p, "
+               "mant-size=%u", type, mantissa_digits);
 end:
        return ret;
 }
@@ -2045,6 +2068,10 @@ int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *type,
                ret = -1;
                goto end;
        }
+
+       BT_LOGV("Added structure field type field: struct-ft-addr=%p, "
+               "field-ft-addr=%p, field-name=\"%s\"", type,
+               field_type, field_name);
 end:
        return ret;
 }
@@ -2116,6 +2143,7 @@ int bt_ctf_field_type_structure_get_field_by_index(
        }
        if (field_name) {
                *field_name = g_quark_to_string(field->name);
+               assert(*field_name);
        }
 end:
        return ret;
@@ -2143,14 +2171,19 @@ struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
 
        name_quark = g_quark_try_string(name);
        if (!name_quark) {
-               BT_LOGE("Cannot get GQuark: string=\"%s\"", name);
+               BT_LOGV("No such structure field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, name);
                goto end;
        }
 
        structure = container_of(type, struct bt_ctf_field_type_structure,
                parent);
        if (!g_hash_table_lookup_extended(structure->field_name_to_index,
-               GUINT_TO_POINTER(name_quark), NULL, (gpointer *)&index)) {
+                       GUINT_TO_POINTER(name_quark), NULL, (gpointer *)&index)) {
+               BT_LOGV("No such structure field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, name);
                goto end;
        }
 
@@ -2303,6 +2336,8 @@ int bt_ctf_field_type_variant_set_tag_name(
 
        variant = container_of(type, struct bt_ctf_field_type_variant, parent);
        g_string_assign(variant->tag_name, name);
+       BT_LOGV("Set variant field type's tag field name: addr=%p, "
+               "tag-field-name=\"%s\"", type, name);
 end:
        return ret;
 }
@@ -2394,6 +2429,11 @@ int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *type,
                ret = -1;
                goto end;
        }
+
+       BT_LOGV("Added variant field type field: variant-ft-addr=%p, "
+               "field-ft-addr=%p, field-name=\"%s\"", type,
+               field_type, field_name);
+
 end:
        return ret;
 }
@@ -2420,13 +2460,18 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
 
        name_quark = g_quark_try_string(field_name);
        if (!name_quark) {
-               BT_LOGE("Cannot get GQuark: string=\"%s\"", field_name);
+               BT_LOGV("No such variant field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, field_name);
                goto end;
        }
 
        variant = container_of(type, struct bt_ctf_field_type_variant, parent);
        if (!g_hash_table_lookup_extended(variant->field_name_to_index,
-               GUINT_TO_POINTER(name_quark), NULL, (gpointer *)&index)) {
+                       GUINT_TO_POINTER(name_quark), NULL, (gpointer *)&index)) {
+               BT_LOGV("No such variant field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, field_name);
                goto end;
        }
 
@@ -2464,7 +2509,8 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
        }
 
        iter = bt_ctf_field_enumeration_get_mappings(tag);
-       if (!iter) {
+       ret = bt_ctf_field_type_enumeration_mapping_iterator_next(iter);
+       if (!iter || ret) {
                BT_LOGE("Cannot get enumeration field type mapping iterator from enumeration field: "
                        "enum-field-addr=%p", tag);
                goto end;
@@ -2551,6 +2597,7 @@ int bt_ctf_field_type_variant_get_field_by_index(struct bt_ctf_field_type *type,
        }
        if (field_name) {
                *field_name = g_quark_to_string(field->name);
+               assert(*field_name);
        }
 end:
        return ret;
@@ -2654,6 +2701,8 @@ int bt_ctf_field_type_array_set_element_type(struct bt_ctf_field_type *type,
 
        array->element_type = element_type;
        bt_get(array->element_type);
+       BT_LOGV("Set array field type's element field type: array-ft-addr=%p, "
+               "element-ft-addr=%p", type, element_type);
 
 end:
        return ret;
@@ -2783,6 +2832,8 @@ int bt_ctf_field_type_sequence_set_element_type(struct bt_ctf_field_type *type,
 
        sequence->element_type = element_type;
        bt_get(sequence->element_type);
+       BT_LOGV("Set sequence field type's element field type: sequence-ft-addr=%p, "
+               "element-ft-addr=%p", type, element_type);
 
 end:
        return ret;
@@ -2888,6 +2939,8 @@ int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *type,
 
        string = container_of(type, struct bt_ctf_field_type_string, parent);
        string->encoding = encoding;
+       BT_LOGV("Set string field type's encoding: addr=%p, encoding=%s",
+               type, bt_ctf_string_encoding_string(encoding));
 end:
        return ret;
 }
@@ -3034,6 +3087,8 @@ int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *type,
 
        type->alignment = alignment;
        ret = 0;
+       BT_LOGV("Set field type's alignment: addr=%p, align=%u",
+               type, alignment);
 end:
        return ret;
 }
@@ -3110,7 +3165,7 @@ int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type,
                        byte_order != BT_CTF_BYTE_ORDER_LITTLE_ENDIAN &&
                        byte_order != BT_CTF_BYTE_ORDER_BIG_ENDIAN &&
                        byte_order != BT_CTF_BYTE_ORDER_NETWORK) {
-               BT_LOGW("Invalid parameter: unknown byte order: "
+               BT_LOGW("Invalid parameter: invalid byte order: "
                        "addr=%p, bo=%s", type,
                        bt_ctf_byte_order_string(byte_order));
                ret = -1;
@@ -3120,6 +3175,10 @@ int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type,
        if (set_byte_order_funcs[type->id]) {
                set_byte_order_funcs[type->id](type, byte_order);
        }
+
+       BT_LOGV("Set field type's byte order: addr=%p, bo=%s",
+               type, bt_ctf_byte_order_string(byte_order));
+
 end:
        return ret;
 }
@@ -3194,7 +3253,6 @@ void bt_ctf_field_type_freeze(struct bt_ctf_field_type *type)
                return;
        }
 
-       BT_LOGD("Freezing field type: addr=%p", type);
        type->freeze(type);
 }
 
@@ -3222,7 +3280,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_signed(
 
        field_name_quark = query.mapping_name;
        if (!g_hash_table_lookup_extended(variant->field_name_to_index,
-               GUINT_TO_POINTER(field_name_quark), NULL, &index)) {
+                       GUINT_TO_POINTER(field_name_quark), NULL, &index)) {
                goto end;
        }
 
@@ -3276,13 +3334,11 @@ int bt_ctf_field_type_serialize(struct bt_ctf_field_type *type,
        assert(type);
        assert(context);
 
-       BT_LOGD("Serializing field type's metadata: "
-               "ft-addr=%p, metadata-context-addr=%p", type, context);
-
        /* Make sure field type is valid before serializing it */
        ret = bt_ctf_field_type_validate(type);
        if (ret) {
-               BT_LOGW_STR("Cannot serialize field type's metadata: field type is invalid.");
+               BT_LOGW("Cannot serialize field type's metadata: field type is invalid: "
+                       "addr=%p", type);
                goto end;
        }
 
@@ -3295,8 +3351,6 @@ struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *type)
 {
        struct bt_ctf_field_type *copy = NULL;
 
-       BT_LOGD("Copying field type object: addr=%p", type);
-
        if (!type) {
                BT_LOGW_STR("Invalid parameter: field type is NULL.");
                goto end;
@@ -3309,7 +3363,6 @@ struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *type)
        }
 
        copy->alignment = type->alignment;
-       BT_LOGD("Copied field type object: copy-ft-addr=%p", copy);
 end:
        return copy;
 }
@@ -3345,7 +3398,9 @@ int bt_ctf_field_type_structure_get_field_name_index(
 
        name_quark = g_quark_try_string(name);
        if (!name_quark) {
-               BT_LOGE("Cannot get GQuark: string=\"%s\"", name);
+               BT_LOGV("No such structure field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, name);
                ret = -1;
                goto end;
        }
@@ -3353,7 +3408,11 @@ int bt_ctf_field_type_structure_get_field_name_index(
        structure = container_of(type, struct bt_ctf_field_type_structure,
                parent);
        if (!g_hash_table_lookup_extended(structure->field_name_to_index,
-               GUINT_TO_POINTER(name_quark), NULL, (gpointer *)&index)) {
+                       GUINT_TO_POINTER(name_quark),
+                       NULL, (gpointer *)&index)) {
+               BT_LOGV("No such structure field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, name);
                ret = -1;
                goto end;
        }
@@ -3362,52 +3421,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
-int bt_ctf_field_type_structure_set_field_index(struct bt_ctf_field_type *type,
-               struct bt_ctf_field_type *field, int index)
-{
-       int ret = 0;
-       struct bt_ctf_field_type_structure *structure;
-
-       if (!type) {
-               BT_LOGW_STR("Invalid parameter: structure field type is NULL.");
-               ret = -1;
-               goto end;
-       }
-
-       if (!field) {
-               BT_LOGW_STR("Invalid parameter: field's field type is NULL.");
-               ret = -1;
-               goto end;
-       }
-
-       if (bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
-               BT_LOGW("Invalid parameter: field type is not a structure field type: "
-                       "addr=%p, ft-id=%s", type,
-                       bt_ctf_field_type_id_string(type->id));
-               ret = -1;
-               goto end;
-       }
-
-       structure = container_of(type, struct bt_ctf_field_type_structure,
-               parent);
-       if (index < 0 || index >= structure->fields->len) {
-               BT_LOGW("Invalid parameter: index is out of bounds: "
-                       "addr=%p, index=%" PRIu64 ", count=%u",
-                       type, index, structure->fields->len);
-               ret = -1;
-               goto end;
-       }
-
-       bt_get(field);
-       bt_put(((struct structure_field *)
-               g_ptr_array_index(structure->fields, index))->type);
-       ((struct structure_field *) structure->fields->pdata[index])->type =
-               field;
-end:
-       return ret;
-}
-
 BT_HIDDEN
 int bt_ctf_field_type_variant_get_field_name_index(
                struct bt_ctf_field_type *type, const char *name)
@@ -3439,7 +3452,9 @@ int bt_ctf_field_type_variant_get_field_name_index(
 
        name_quark = g_quark_try_string(name);
        if (!name_quark) {
-               BT_LOGE("Cannot get GQuark: string=\"%s\"", name);
+               BT_LOGV("No such variant field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, name);
                ret = -1;
                goto end;
        }
@@ -3447,7 +3462,11 @@ int bt_ctf_field_type_variant_get_field_name_index(
        variant = container_of(type, struct bt_ctf_field_type_variant,
                parent);
        if (!g_hash_table_lookup_extended(variant->field_name_to_index,
-               GUINT_TO_POINTER(name_quark), NULL, (gpointer *)&index)) {
+                       GUINT_TO_POINTER(name_quark),
+                       NULL, (gpointer *)&index)) {
+               BT_LOGV("No such variant field type field name: "
+                       "ft-addr=%p, field-name=\"%s\"",
+                       type, name);
                ret = -1;
                goto end;
        }
@@ -3482,6 +3501,8 @@ int bt_ctf_field_type_sequence_set_length_field_path(
                parent);
        bt_get(path);
        BT_MOVE(sequence->length_field_path, path);
+       BT_LOGV("Set sequence field type's length field path: ft-addr=%p, "
+               "field-path-addr=%p", type, path);
 end:
        return ret;
 }
@@ -3511,6 +3532,8 @@ int bt_ctf_field_type_variant_set_tag_field_path(struct bt_ctf_field_type *type,
                parent);
        bt_get(path);
        BT_MOVE(variant->tag_field_path, path);
+       BT_LOGV("Set variant field type's tag field path: ft-addr=%p, "
+               "field-path-addr=%p", type, path);
 end:
        return ret;
 }
@@ -3550,6 +3573,8 @@ int bt_ctf_field_type_variant_set_tag_field_type(struct bt_ctf_field_type *type,
        }
        variant->tag = container_of(tag, struct bt_ctf_field_type_enumeration,
                parent);
+       BT_LOGV("Set variant field type's tag field type: variant-ft-addr=%p, "
+               "tag-ft-addr=%p", type, tag);
 end:
        return ret;
 }
@@ -3565,6 +3590,7 @@ void bt_ctf_field_type_integer_destroy(struct bt_ctf_field_type *type)
        }
 
        BT_LOGD("Destroying integer field type object: addr=%p", type);
+       BT_LOGD_STR("Putting mapped clock class.");
        bt_put(integer->mapped_clock);
        g_free(integer);
 }
@@ -3581,6 +3607,7 @@ void bt_ctf_field_type_enumeration_destroy(struct bt_ctf_field_type *type)
 
        BT_LOGD("Destroying enumeration field type object: addr=%p", type);
        g_ptr_array_free(enumeration->entries, TRUE);
+       BT_LOGD_STR("Putting container field type.");
        bt_put(enumeration->container);
        g_free(enumeration);
 }
@@ -3629,6 +3656,7 @@ void bt_ctf_field_type_variant_destroy(struct bt_ctf_field_type *type)
        g_ptr_array_free(variant->fields, TRUE);
        g_hash_table_destroy(variant->field_name_to_index);
        g_string_free(variant->tag_name, TRUE);
+       BT_LOGD_STR("Putting tag field type.");
        bt_put(&variant->tag->parent);
        BT_PUT(variant->tag_field_path);
        g_free(variant);
@@ -3645,6 +3673,7 @@ void bt_ctf_field_type_array_destroy(struct bt_ctf_field_type *type)
        }
 
        BT_LOGD("Destroying array field type object: addr=%p", type);
+       BT_LOGD_STR("Putting element field type.");
        bt_put(array->element_type);
        g_free(array);
 }
@@ -3660,8 +3689,10 @@ void bt_ctf_field_type_sequence_destroy(struct bt_ctf_field_type *type)
        }
 
        BT_LOGD("Destroying sequence field type object: addr=%p", type);
+       BT_LOGD_STR("Putting element field type.");
        bt_put(sequence->element_type);
        g_string_free(sequence->length_field_name, TRUE);
+       BT_LOGD_STR("Putting length field path.");
        BT_PUT(sequence->length_field_path);
        g_free(sequence);
 }
@@ -3695,6 +3726,7 @@ void bt_ctf_field_type_integer_freeze(struct bt_ctf_field_type *type)
        BT_LOGD("Freezing integer field type object: addr=%p", type);
 
        if (integer_type->mapped_clock) {
+               BT_LOGD_STR("Freezing integer field type's mapped clock class.");
                bt_ctf_clock_class_freeze(integer_type->mapped_clock);
        }
 
@@ -3710,13 +3742,17 @@ void bt_ctf_field_type_enumeration_freeze(struct bt_ctf_field_type *type)
        BT_LOGD("Freezing enumeration field type object: addr=%p", type);
        set_enumeration_range_overlap(type);
        generic_field_type_freeze(type);
+       BT_LOGD("Freezing enumeration field type object's container field type: int-ft-addr=%p",
+               enumeration_type->container);
        bt_ctf_field_type_freeze(enumeration_type->container);
 }
 
 static
 void freeze_structure_field(struct structure_field *field)
 {
-       BT_LOGD("Freezing structure field type field: addr=%p", field);
+       BT_LOGD("Freezing structure/variant field type field: field-addr=%p, "
+               "field-ft-addr=%p, field-name=\"%s\"", field,
+               field->type, g_quark_to_string(field->name));
        bt_ctf_field_type_freeze(field->type);
 }
 
@@ -3756,6 +3792,8 @@ void bt_ctf_field_type_array_freeze(struct bt_ctf_field_type *type)
        BT_LOGD("Freezing array field type object: addr=%p", type);
        type->alignment = bt_ctf_field_type_get_alignment(type);
        generic_field_type_freeze(type);
+       BT_LOGD("Freezing array field type object's element field type: element-ft-addr=%p",
+               array_type->element_type);
        bt_ctf_field_type_freeze(array_type->element_type);
 }
 
@@ -3769,6 +3807,8 @@ void bt_ctf_field_type_sequence_freeze(struct bt_ctf_field_type *type)
        BT_LOGD("Freezing sequence field type object: addr=%p", type);
        type->alignment = bt_ctf_field_type_get_alignment(type);
        generic_field_type_freeze(type);
+       BT_LOGD("Freezing sequence field type object's element field type: element-ft-addr=%p",
+               sequence_type->element_type);
        bt_ctf_field_type_freeze(sequence_type->element_type);
 }
 
@@ -3802,6 +3842,7 @@ const char *get_integer_base_string(enum bt_ctf_integer_base base)
 
        switch (base) {
        case BT_CTF_INTEGER_BASE_DECIMAL:
+       case BT_CTF_INTEGER_BASE_UNSPECIFIED:
                base_string = "decimal";
                break;
        case BT_CTF_INTEGER_BASE_HEXADECIMAL:
@@ -3869,6 +3910,7 @@ int bt_ctf_field_type_enumeration_serialize(struct bt_ctf_field_type *type,
        container_signed = bt_ctf_field_type_integer_get_signed(container_type);
        assert(container_signed >= 0);
        g_string_append(context->string, "enum : ");
+       BT_LOGD_STR("Serializing enumeration field type's container field type's metadata.");
        ret = bt_ctf_field_type_serialize(enumeration->container, context);
        if (ret) {
                BT_LOGW("Cannot serialize enumeration field type's container field type's metadata: "
@@ -3950,7 +3992,7 @@ int bt_ctf_field_type_structure_serialize(struct bt_ctf_field_type *type,
 {
        size_t i;
        unsigned int indent;
-       int64_t ret = 0;
+       int ret = 0;
        struct bt_ctf_field_type_structure *structure = container_of(type,
                struct bt_ctf_field_type_structure, parent);
        GString *structure_field_name = context->field_name;
@@ -3963,20 +4005,24 @@ int bt_ctf_field_type_structure_serialize(struct bt_ctf_field_type *type,
        g_string_append(context->string, "struct {\n");
 
        for (i = 0; i < structure->fields->len; i++) {
-               struct structure_field *field;
+               struct structure_field *field = structure->fields->pdata[i];
+
+               BT_LOGD("Serializing structure field type's field metadata: "
+                       "index=%zu, "
+                       "field-ft-addr=%p, field-name=\"%s\"",
+                       i, field, g_quark_to_string(field->name));
 
                for (indent = 0; indent < context->current_indentation_level;
                        indent++) {
                        g_string_append_c(context->string, '\t');
                }
 
-               field = structure->fields->pdata[i];
                g_string_assign(context->field_name,
                        g_quark_to_string(field->name));
                ret = bt_ctf_field_type_serialize(field->type, context);
                if (ret) {
                        BT_LOGW("Cannot serialize structure field type's field's metadata: "
-                               "index=%" PRId64 ", "
+                               "index=%zu, "
                                "field-ft-addr=%p, field-name=\"%s\"",
                                i, field->type,
                                g_quark_to_string(field->name));
@@ -4029,6 +4075,11 @@ int bt_ctf_field_type_variant_serialize(struct bt_ctf_field_type *type,
        for (i = 0; i < variant->fields->len; i++) {
                struct structure_field *field = variant->fields->pdata[i];
 
+               BT_LOGD("Serializing variant field type's field metadata: "
+                       "index=%zu, "
+                       "field-ft-addr=%p, field-name=\"%s\"",
+                       i, field, g_quark_to_string(field->name));
+
                g_string_assign(context->field_name,
                        g_quark_to_string(field->name));
                for (indent = 0; indent < context->current_indentation_level;
@@ -4041,7 +4092,7 @@ int bt_ctf_field_type_variant_serialize(struct bt_ctf_field_type *type,
                ret = bt_ctf_field_type_serialize(field->type, context);
                if (ret) {
                        BT_LOGW("Cannot serialize variant field type's field's metadata: "
-                               "index=%" PRId64 ", "
+                               "index=%zu, "
                                "field-ft-addr=%p, field-name=\"%s\"",
                                i, field->type,
                                g_quark_to_string(field->name));
@@ -4079,6 +4130,7 @@ int bt_ctf_field_type_array_serialize(struct bt_ctf_field_type *type,
 
        BT_LOGD("Serializing array field type's metadata: "
                "ft-addr=%p, metadata-context-addr=%p", type, context);
+       BT_LOGD_STR("Serializing array field type's element field type's metadata.");
        ret = bt_ctf_field_type_serialize(array->element_type, context);
        if (ret) {
                BT_LOGW("Cannot serialize array field type's element field type's metadata: "
@@ -4107,6 +4159,7 @@ int bt_ctf_field_type_sequence_serialize(struct bt_ctf_field_type *type,
 
        BT_LOGD("Serializing sequence field type's metadata: "
                "ft-addr=%p, metadata-context-addr=%p", type, context);
+       BT_LOGD_STR("Serializing sequence field type's element field type's metadata.");
        ret = bt_ctf_field_type_serialize(sequence->element_type, context);
        if (ret) {
                BT_LOGW("Cannot serialize sequence field type's element field type's metadata: "
@@ -4290,6 +4343,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_copy(
                parent);
 
        /* Copy the source enumeration's container */
+       BT_LOGD_STR("Copying enumeration field type's container field type.");
        copy_container = bt_ctf_field_type_copy(enumeration->container);
        if (!copy_container) {
                BT_LOGE_STR("Cannot copy enumeration field type's container field type.");
@@ -4392,13 +4446,17 @@ struct bt_ctf_field_type *bt_ctf_field_type_structure_copy(
                struct structure_field *entry, *copy_entry;
                struct bt_ctf_field_type *copy_field;
 
+               entry = g_ptr_array_index(structure->fields, i);
+               BT_LOGD("Copying structure field type's field: "
+                       "index=%" PRId64 ", "
+                       "field-ft-addr=%p, field-name=\"%s\"",
+                       i, entry, g_quark_to_string(entry->name));
                copy_entry = g_new0(struct structure_field, 1);
                if (!copy_entry) {
                        BT_LOGE_STR("Failed to allocate one structure field type field.");
                        goto error;
                }
 
-               entry = g_ptr_array_index(structure->fields, i);
                copy_field = bt_ctf_field_type_copy(entry->type);
                if (!copy_field) {
                        BT_LOGE("Cannot copy structure field type's field: "
@@ -4438,6 +4496,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_copy(
        variant = container_of(type, struct bt_ctf_field_type_variant,
                parent);
        if (variant->tag) {
+               BT_LOGD_STR("Copying variant field type's tag field type.");
                copy_tag = bt_ctf_field_type_copy(&variant->tag->parent);
                if (!copy_tag) {
                        BT_LOGE_STR("Cannot copy variant field type's tag field type.");
@@ -4466,13 +4525,17 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_copy(
                struct structure_field *entry, *copy_entry;
                struct bt_ctf_field_type *copy_field;
 
+               entry = g_ptr_array_index(variant->fields, i);
+               BT_LOGD("Copying variant field type's field: "
+                       "index=%" PRId64 ", "
+                       "field-ft-addr=%p, field-name=\"%s\"",
+                       i, entry, g_quark_to_string(entry->name));
                copy_entry = g_new0(struct structure_field, 1);
                if (!copy_entry) {
                        BT_LOGE_STR("Failed to allocate one variant field type field.");
                        goto error;
                }
 
-               entry = g_ptr_array_index(variant->fields, i);
                copy_field = bt_ctf_field_type_copy(entry->type);
                if (!copy_field) {
                        BT_LOGE("Cannot copy variant field type's field: "
@@ -4489,6 +4552,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_copy(
        }
 
        if (variant->tag_field_path) {
+               BT_LOGD_STR("Copying variant field type's tag field path.");
                copy_variant->tag_field_path = bt_ctf_field_path_copy(
                        variant->tag_field_path);
                if (!copy_variant->tag_field_path) {
@@ -4519,6 +4583,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_array_copy(
        BT_LOGD("Copying array field type's: addr=%p", type);
        array = container_of(type, struct bt_ctf_field_type_array,
                parent);
+       BT_LOGD_STR("Copying array field type's element field type.");
        copy_element = bt_ctf_field_type_copy(array->element_type);
        if (!copy_element) {
                BT_LOGE_STR("Cannot copy array field type's element field type.");
@@ -4549,6 +4614,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_copy(
        BT_LOGD("Copying sequence field type's: addr=%p", type);
        sequence = container_of(type, struct bt_ctf_field_type_sequence,
                parent);
+       BT_LOGD_STR("Copying sequence field type's element field type.");
        copy_element = bt_ctf_field_type_copy(sequence->element_type);
        if (!copy_element) {
                BT_LOGE_STR("Cannot copy sequence field type's element field type.");
@@ -4566,6 +4632,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_copy(
        copy_sequence = container_of(copy, struct bt_ctf_field_type_sequence,
                parent);
        if (sequence->length_field_path) {
+               BT_LOGD_STR("Copying sequence field type's length field path.");
                copy_sequence->length_field_path = bt_ctf_field_path_copy(
                        sequence->length_field_path);
                if (!copy_sequence->length_field_path) {
@@ -4590,7 +4657,6 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_copy(
                struct bt_ctf_field_type *type)
 {
        struct bt_ctf_field_type *copy;
-       struct bt_ctf_field_type_string *string;
 
        BT_LOGD("Copying string field type's: addr=%p", type);
        copy = bt_ctf_field_type_string_create();
@@ -4599,8 +4665,6 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_copy(
                goto end;
        }
 
-       string = container_of(type, struct bt_ctf_field_type_string,
-               parent);
        BT_LOGD("Copied string field type: original-ft-addr=%p, copy-ft-addr=%p",
                type, copy);
 end:
@@ -4668,8 +4732,8 @@ int bt_ctf_field_type_integer_compare(struct bt_ctf_field_type *type_a,
        if (int_type_a->mapped_clock != int_type_b->mapped_clock) {
                BT_LOGV("Integer field types differ: different mapped clock classes: "
                        "ft-a-mapped-clock-class-addr=%p, "
-                       "ft-b-mapped-clock-class-addr=%p, ",
-                       "ft-a-mapped-clock-class-name=\"%s\", ",
+                       "ft-b-mapped-clock-class-addr=%p, "
+                       "ft-a-mapped-clock-class-name=\"%s\", "
                        "ft-b-mapped-clock-class-name=\"%s\"",
                        int_type_a->mapped_clock, int_type_b->mapped_clock,
                        int_type_a->mapped_clock ? bt_ctf_clock_class_get_name(int_type_a->mapped_clock) : "",
@@ -4709,7 +4773,7 @@ int bt_ctf_field_type_floating_point_compare(struct bt_ctf_field_type *type_a,
        /* Exponent length */
        if (float_a->exp_dig != float_b->exp_dig) {
                BT_LOGV("Floating point number field types differ: different exponent sizes: "
-                       "ft-a-exp-size=%s, ft-b-exp-size=%s",
+                       "ft-a-exp-size=%u, ft-b-exp-size=%u",
                        float_a->exp_dig, float_b->exp_dig);
                goto end;
        }
@@ -4717,7 +4781,7 @@ int bt_ctf_field_type_floating_point_compare(struct bt_ctf_field_type *type_a,
        /* Mantissa length */
        if (float_a->mant_dig != float_b->mant_dig) {
                BT_LOGV("Floating point number field types differ: different mantissa sizes: "
-                       "ft-a-mant-size=%s, ft-b-mant-size=%s",
+                       "ft-a-mant-size=%u, ft-b-mant-size=%u",
                        float_a->mant_dig, float_b->mant_dig);
                goto end;
        }
@@ -4875,7 +4939,7 @@ int compare_structure_fields(struct structure_field *field_a,
        ret = bt_ctf_field_type_compare(field_a->type, field_b->type);
        if (ret == 1) {
                BT_LOGV("Structure/variant field type fields differ: different field types: "
-                       "field-name=\"%s\", field-a-ft-addr=%s, field-b-ft-addr=%s",
+                       "field-name=\"%s\", field-a-ft-addr=%p, field-b-ft-addr=%p",
                        g_quark_to_string(field_a->name),
                        field_a->type, field_b->type);
        }
@@ -4954,7 +5018,7 @@ int bt_ctf_field_type_variant_compare(struct bt_ctf_field_type *type_a,
        /* Tag name */
        if (strcmp(variant_a->tag_name->str, variant_b->tag_name->str)) {
                BT_LOGV("Variant field types differ: different tag field names: "
-                       "ft-a-tag-field-name=%u, ft-b-tag-field-name=%u",
+                       "ft-a-tag-field-name=\"%s\", ft-b-tag-field-name=\"%s\"",
                        variant_a->tag_name->str, variant_b->tag_name->str);
                goto end;
        }
@@ -5052,7 +5116,8 @@ int bt_ctf_field_type_sequence_compare(struct bt_ctf_field_type *type_a,
        if (strcmp(sequence_a->length_field_name->str,
                        sequence_b->length_field_name->str)) {
                BT_LOGV("Sequence field types differ: different length field names: "
-                       "ft-a-length-field-name=%u, ft-b-length-field-name=%u",
+                       "ft-a-length-field-name=\"%s\", "
+                       "ft-b-length-field-name=\"%s\"",
                        sequence_a->length_field_name->str,
                        sequence_b->length_field_name->str);
                goto end;
@@ -5160,9 +5225,15 @@ struct bt_ctf_field_type *bt_ctf_field_type_get_field_at_index(
 
        switch (type_id) {
        case CTF_TYPE_STRUCT:
-               bt_ctf_field_type_structure_get_field_by_index(field_type,
-                       NULL, &field, index);
+       {
+               int ret = bt_ctf_field_type_structure_get_field_by_index(
+                       field_type, NULL, &field, index);
+               if (ret) {
+                       field = NULL;
+                       goto end;
+               }
                break;
+       }
        case CTF_TYPE_VARIANT:
        {
                int ret = bt_ctf_field_type_variant_get_field_by_index(
This page took 0.040682 seconds and 4 git commands to generate.