ruby: tweak inspect

develop
jj 2012-04-27 17:38:31 +02:00
parent 9bceb7a443
commit 3446fd024e
1 changed files with 2 additions and 1 deletions

@ -127,13 +127,14 @@ class Compound < MemStruct
end end
out << inspect_field(n, o, s) out << inspect_field(n, o, s)
} }
out.chomp!(' ')
out << '>' out << '>'
end end
def inspect_field(n, o, s) def inspect_field(n, o, s)
if s.kind_of?(BitField) and s._len == 1 if s.kind_of?(BitField) and s._len == 1
send(n) ? n.to_s : '' send(n) ? n.to_s : ''
elsif s.kind_of?(Pointer) elsif s.kind_of?(Pointer)
s._at(@_memaddr+o).inspect "#{n}=#{s._at(@_memaddr+o).inspect}"
elsif n == :_whole elsif n == :_whole
"_whole=0x#{_whole.to_s(16)}" "_whole=0x#{_whole.to_s(16)}"
else else