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 = []
if object and ! object.is_a?(String)
clazz = object.class.name.split("::").last
fields << "#{clazz}:#{object.internal_object_length}"
fields << "--------------------"
fields << ["#{clazz}:#{object.internal_object_length}" , 0]
fields << ["--------------------" , 0 ]
object.get_instance_variables.each do |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
fields
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