Add field validation logging
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 15 Nov 2016 16:36:09 +0000 (11:36 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:06 +0000 (14:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/fields.c

index 2aeb71b53ba0880eeb05c1a20d7d69a90a165024..7d5f744c19b23cbdfbd81b0061bb0a9cf43c8093 100644 (file)
@@ -1592,6 +1592,14 @@ int bt_ctf_field_structure_validate(struct bt_ctf_field *field)
        for (i = 0; i < structure->fields->len; i++) {
                ret = bt_ctf_field_validate(structure->fields->pdata[i]);
                if (ret) {
+                       const char *name;
+                       struct bt_ctf_field_type *field_type =
+                                       bt_ctf_field_get_type(field);
+
+                       (void) bt_ctf_field_type_structure_get_field(field_type,
+                                       &name, NULL, i);
+                       fprintf(stderr, "Field %s failed validation\n",
+                                       name ? name : "NULL");
                        goto end;
                }
        }
@@ -1655,6 +1663,7 @@ int bt_ctf_field_sequence_validate(struct bt_ctf_field *field)
        for (i = 0; i < sequence->elements->len; i++) {
                ret = bt_ctf_field_validate(sequence->elements->pdata[i]);
                if (ret) {
+                       fprintf(stderr, "Failed to validate sequence field %zu\n", i);
                        goto end;
                }
        }
This page took 0.025842 seconds and 4 git commands to generate.