Fix: src.text.details: use write_uint_prop_value to handle unsigned values in write_i...
authorSimon Marchi <simon.marchi@efficios.com>
Sat, 5 Mar 2022 01:20:34 +0000 (20:20 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 8 Mar 2022 17:46:09 +0000 (12:46 -0500)
I tried creating an option field class with unsigned integer selector,
with a [1, UINT64_MAX] range.  The details field class shows it as:

     opt_with_uint_sel: Option (unsigned integer selector) (Selector field location [Event payload: uint_selector]):
      Selector ranges: [1, -1]

The -1 is wrong.  Fix two spots to call write_uint_prop_value instead of
write_int_prop_value.

After:

    opt_with_uint_sel: Option (unsigned integer selector) (Selector field location [Event payload: uint_selector]):
       Selector ranges: [1, 18,446,744,073,709,551,615]

Change-Id: I83344b2a241f597da86c21da030b40eed2a4955f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7228
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/text/details/write.c

index 6d555a5f1b488c50bcdcdc9cf15fbe1c1e69555e..dfe77b869dbc628211beef3020d84d7150743cea 100644 (file)
@@ -682,7 +682,7 @@ void write_int_range(struct details_write_ctx *ctx,
        if (is_signed) {
                write_int_prop_value(ctx, range->lower.i);
        } else {
-               write_int_prop_value(ctx, range->lower.u);
+               write_uint_prop_value(ctx, range->lower.u);
        }
 
        if (range->lower.u != range->upper.u) {
@@ -691,7 +691,7 @@ void write_int_range(struct details_write_ctx *ctx,
                if (is_signed) {
                        write_int_prop_value(ctx, range->upper.i);
                } else {
-                       write_int_prop_value(ctx, range->upper.u);
+                       write_uint_prop_value(ctx, range->upper.u);
                }
        }
 
This page took 0.02862 seconds and 4 git commands to generate.