Commit 9e0c1993 authored by Brice Videau's avatar Brice Videau
Browse files

Fix babeltrace_ze display of handles.

parent c1923ea6
Pipeline #13133 canceled with stage
......@@ -69,6 +69,8 @@ EOF
"s << \"#{p.name}: \#{ZE::#{to_class_name(t)}.from_native(defi[\"#{p.name}\"], nil)}\""
elsif $all_bitfield_names.include?(t)
"s << \"#{p.name}: [ \#{ZE::#{to_class_name(t)}.from_native(defi[\"#{p.name}\"], nil).join(\", \")} ]\""
elsif $all_struct_names.include?(t)
"s << \"#{p.name}: \#{ZE::#{to_class_name(t)}.new(FFI::MemoryPointer.from_string(defi[\"#{p.name}\"]))}\""
else
"s << \"#{p.name}: \#{defi[\"#{p.name}\"]}\""
end
......
......@@ -221,6 +221,14 @@ module ZE
ver & 0x0000ffff
end
module Handle
def to_s
s = '{ data: "'
s << self[:data].to_a.collect { |v| "%02x" % v }.join(" ")
s << '" }'
end
end
module UUID
def to_s
a = self[:id].to_a
......@@ -356,6 +364,10 @@ EOF
prepend UUID
EOF
end
elsif to_class_name(name).match(/Handle\z/)
puts <<EOF
prepend Handle
EOF
end
puts <<EOF
layout #{members.collect(&print_lambda).join(",\n"+" "*11)}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment