X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftsdl-trace-class-visitor.cpp;h=c02addcebdb0d1a902b1c18d7aa75dc8a65c310e;hb=45110cdd99bd9ecc13a12d29afde3fffa48b4641;hp=bccd62737b01374284464c17213e991cc63f56fe;hpb=6e01cdc6c6e9cd18d99e8898fa3df41911388e8e;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp b/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp index bccd62737..c02addceb 100644 --- a/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp +++ b/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp @@ -146,7 +146,7 @@ private: _current_field_name.push(_bypass_identifier_escape ? field.name : escape_tsdl_identifier(field.name)); - field._type->accept(*this); + field.get_type().accept(*this); _description += " "; _description += _current_field_name.top(); _current_field_name.pop(); @@ -411,7 +411,8 @@ private: _description += "}"; } - virtual void visit(const lst::variant_type& type) override final + template + void visit_variant(const lst::variant_type& type) { if (type.alignment != 0) { LTTNG_ASSERT(_current_field_name.size() > 0); @@ -438,8 +439,8 @@ private: _bypass_identifier_escape = true; for (const auto& field : type._choices) { _description.resize(_description.size() + _indentation_level, '\t'); - field->accept(*this); - _description += fmt::format("\n", field->name); + field.second->accept(*this); + _description += fmt::format(" {};\n", field.first.name); } _bypass_identifier_escape = previous_bypass_identifier_escape; @@ -449,6 +450,16 @@ private: _description += "}"; } + virtual void visit(const lst::variant_type& type) override final + { + visit_variant(type); + } + + virtual void visit(const lst::variant_type& type) override final + { + visit_variant(type); + } + lst::type::cuptr create_character_type(enum lst::string_type::encoding encoding) { _current_integer_encoding_override = encoding;