getting the levels right in registers

This commit is contained in:
Torsten Ruger 2015-08-14 20:14:00 +03:00
parent 3d2dadbd62
commit 5583a7a56c
2 changed files with 33 additions and 29 deletions

View File

@ -33,15 +33,27 @@ module Main
fields = [] fields = []
if object and ! object.is_a?(String) if object and ! object.is_a?(String)
clazz = object.class.name.split("::").last clazz = object.class.name.split("::").last
fields << "#{clazz}:#{object.internal_object_length}" fields << ["#{clazz}:#{object.internal_object_length}" , 0]
fields << "--------------------" fields << ["--------------------" , 0 ]
object.get_instance_variables.each do |variable| object.get_instance_variables.each do |variable|
f = object.get_instance_variable(variable) f = object.get_instance_variable(variable)
fields << "#{f.class.name.split('::').last} : #{f.object_id}" fields << ["#{variable} : #{marker(f)} : #{f.object_id}" , f.object_id]
end end
end end
fields fields
end end
def variables(attribute)
model_name = attribute.class.name.split("::").last
vars = []
cl = Virtual.machine.space.get_class_by_name(model_name)
return vars unless cl
layout = cl.object_layout
layout.object_instance_names.each do |name|
vars.push name
end
vars
end
end end
end end

View File

@ -5,32 +5,24 @@
<div class="registers-view"> <div class="registers-view">
{{ model.each do |reg| }} {{ model.each do |reg| }}
<div class="register-view"> <div class="register-view">
<div> <ul id="nav">
<div class="field"> <a href="#">{{reg.name}} : {{reg.value}}</a>
{{ reg.name }}
</div>
<div class="value">
<span class="value-head">
{{ reg.value }}
</span>
</div>
</div>
{{ reg.fields.each_with_index do |attribute, index| }} {{ reg.fields.each_with_index do |attribute, index| }}
<div> <li class="field">
<div class="field tooltip"> <a href="#">
{{index}}{{marker(attribute)}} {{index}}{{marker(attribute)}}
<span>
{{variables(attribute).join("\n")}}
</span>
</div>
<div class="value tooltip">
{{attribute.object_id}} {{attribute.object_id}}
<span> </a>
{{content(attribute.object_id).join("\n")}} <ul>
</span> {{content(attribute.object_id).each do |con| }}
</div> <li>
</div> <a href="#">{{con[0]}}</a>
{{end}} </li>
{{end}}
</ul>
</li>
{{end}}
</ul>
</div> </div>
{{end}} {{end}}
</div> </div>