fix debug
This commit is contained in:
parent
20b28077a1
commit
c9ec6e2f39
@ -29,14 +29,14 @@ module Elf
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
space.main.blocks.each do |b|
|
# @object_machine.space.main.blocks.each do |b|
|
||||||
add_symbol "main@#{b.name}" , b.position
|
# add_symbol "main@#{b.name}" , b.position
|
||||||
end
|
# end
|
||||||
add_symbol "#register@#{space.init.name}" , space.init.position
|
# add_symbol "#register@#{@object_machine.space.init.name}" , @object_machine.space.init.position
|
||||||
assembler.objects.values.each do |slot|
|
@object_machine.objects.each do |slot|
|
||||||
label = "#{slot.class.name}::#{slot.position.to_s(16)}"
|
label = "#{slot.class.name}::#{slot.position.to_s(16)}"
|
||||||
label += "=#{slot}" if slot.is_a?(Symbol) or slot.is_a?(String)
|
label += "=#{slot}" if slot.is_a?(Symbol) or slot.is_a?(String)
|
||||||
label += "=#{slot.string}" if slot.is_a?(Parfait::Word)
|
label += "=#{slot.name}" if slot.is_a?(Parfait::BinaryCode)
|
||||||
add_symbol label , slot.position
|
add_symbol label , slot.position
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,9 +2,9 @@ module Register
|
|||||||
class LinkException < Exception
|
class LinkException < Exception
|
||||||
end
|
end
|
||||||
# Assemble the object machine into a binary.
|
# Assemble the object machine into a binary.
|
||||||
# Link first to get positions, then assemble
|
# Assemble first to get positions, then write
|
||||||
|
|
||||||
# The link function determines the length of an object and the assemble actually
|
# The assemble function determines the length of an object and then actually
|
||||||
# writes the bytes they are pretty much dependant. In an earlier version they were
|
# writes the bytes they are pretty much dependant. In an earlier version they were
|
||||||
# functions on the objects, but now it has gone to a visitor pattern.
|
# functions on the objects, but now it has gone to a visitor pattern.
|
||||||
|
|
||||||
@ -25,6 +25,7 @@ module Register
|
|||||||
# binary code (array) to right length
|
# binary code (array) to right length
|
||||||
@machine.objects.each do |objekt|
|
@machine.objects.each do |objekt|
|
||||||
next unless objekt.is_a? Parfait::Method
|
next unless objekt.is_a? Parfait::Method
|
||||||
|
# should be fill_to_length (with zeros)
|
||||||
objekt.code.set_length(objekt.info.byte_length , 0)
|
objekt.code.set_length(objekt.info.byte_length , 0)
|
||||||
end
|
end
|
||||||
at = 0
|
at = 0
|
||||||
|
@ -17,7 +17,7 @@ module Virtual
|
|||||||
@codes = []
|
@codes = []
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :name , :codes , :method
|
attr_reader :name , :codes , :method , :position
|
||||||
attr_accessor :branch
|
attr_accessor :branch
|
||||||
|
|
||||||
def reachable ret = []
|
def reachable ret = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user