flt.lttng-utils.debug-info: copy bit array field class and field objects
[babeltrace.git] / src / plugins / lttng-utils / debug-info / trace-ir-data-copy.c
index 274c3170ee2b9f19b901a3b09370250827d29db3..e499ea3c7c907e8be42289fa05d1c1e536084f7c 100644 (file)
@@ -26,7 +26,7 @@
 #define BT_COMP_LOG_SELF_COMP self_comp
 #define BT_LOG_OUTPUT_LEVEL log_level
 #define BT_LOG_TAG "PLUGIN/FLT.LTTNG-UTILS.DEBUG-INFO/TRACE-IR-DATA-COPY"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
 
 #include <inttypes.h>
 #include <stdint.h>
@@ -219,6 +219,14 @@ void copy_field_content(const bt_field *in_field, bt_field *out_field,
        BT_COMP_LOGT("Copying content of field: in-f-addr=%p, out-f-addr=%p",
                        in_field, out_field);
        switch (in_fc_type) {
+       case BT_FIELD_CLASS_TYPE_BOOL:
+               bt_field_bool_set_value(out_field,
+                       bt_field_bool_get_value(in_field));
+               break;
+       case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
+               bt_field_bit_array_set_value_as_integer(out_field,
+                       bt_field_bit_array_get_value_as_integer(in_field));
+               break;
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
        case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
                bt_field_integer_unsigned_set_value(out_field,
@@ -319,6 +327,26 @@ void copy_field_content(const bt_field *in_field, bt_field *out_field,
                }
                break;
        }
+       case BT_FIELD_CLASS_TYPE_OPTION:
+       {
+               const bt_field *in_option_field;
+               bt_field *out_option_field;
+
+               in_option_field = bt_field_option_borrow_field_const(in_field);
+
+               if (in_option_field) {
+                       bt_field_option_set_has_field(out_field, BT_TRUE);
+                       out_option_field = bt_field_option_borrow_field(
+                               out_field);
+                       BT_ASSERT(out_option_field);
+                       copy_field_content(in_option_field, out_option_field,
+                               log_level, self_comp);
+               } else {
+                       bt_field_option_set_has_field(out_field, BT_FALSE);
+               }
+
+               break;
+       }
        case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR:
        case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR:
        case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR:
This page took 0.025281 seconds and 4 git commands to generate.