diff --git a/lib/elf/object_writer.rb b/lib/elf/object_writer.rb index 60ca5fbb..072bd64d 100644 --- a/lib/elf/object_writer.rb +++ b/lib/elf/object_writer.rb @@ -30,7 +30,7 @@ module Elf add_symbol "#{type.name}@#{meth.name}:Label=#{label.name}" , Risc::Position.get(label).at end meth.binary.each_block do |code| - label = "BinaryCode@#{Risc::Position.get(code).method.name}" + label = "BinaryCode@#{meth.name}" add_symbol label , Risc::Position.get(code).at end end diff --git a/lib/risc/interpreter.rb b/lib/risc/interpreter.rb index 4ffa77ab..03b847d1 100644 --- a/lib/risc/interpreter.rb +++ b/lib/risc/interpreter.rb @@ -225,7 +225,7 @@ module Risc def execute_FunctionReturn link = get_register( @instruction.register ) - log.debug "Return to #{link}" + log.debug "Return to #{link} #{link.class}" set_pc link false end diff --git a/test/arm/test_logic.rb b/test/arm/test_logic.rb index 929a466b..8c78c482 100644 --- a/test/arm/test_logic.rb +++ b/test/arm/test_logic.rb @@ -89,7 +89,7 @@ module Arm assert_code code.next , :add , [0x22,0x10,0x91,0xe2] #e2 91 10 22 end - def label( pos = 0x12 + 8) + def label( pos = 0x22 + 8) label = Risc::Label.new("some" , "Label" , FakeAddress.new(pos)) Risc::Position.new(label , pos) #Risc::Position.set(l , pos , @binary) @@ -98,7 +98,7 @@ module Arm def test_move_object code = @machine.add( :r1 , label) - Risc::Position.new(code,12) + Risc::Position.new(code,0) assert_code code , :add , [0x22,0x10,0x9f,0xe2] #e2 9f 10 22 end diff --git a/test/mom/send/test_setup_simple.rb b/test/mom/send/test_setup_simple.rb index e64f9991..f3cb6309 100644 --- a/test/mom/send/test_setup_simple.rb +++ b/test/mom/send/test_setup_simple.rb @@ -43,7 +43,7 @@ module Risc def test_get_args_type #from method in r1 sl = @produced.next( 5 ) - assert_slot_to_reg( sl , :r1 , 6 , :r4 ) + assert_slot_to_reg( sl , :r1 , 5 , :r4 ) end def test_get_args #from message sl = @produced.next( 6 ) @@ -56,7 +56,7 @@ module Risc def test_get_frame_type #from method in r1 sl = @produced.next( 8 ) - assert_slot_to_reg( sl , :r1 , 8 , :r4 ) + assert_slot_to_reg( sl , :r1 , 7 , :r4 ) end def test_get_frame #from message sl = @produced.next( 9 ) diff --git a/test/risc/interpreter/calling/test_minus.rb b/test/risc/interpreter/calling/test_minus.rb index 6c91bb3c..2a13d790 100644 --- a/test/risc/interpreter/calling/test_minus.rb +++ b/test/risc/interpreter/calling/test_minus.rb @@ -46,7 +46,7 @@ module Risc ret = main_ticks(63) assert_equal FunctionReturn , ret.class assert_equal :r1 , ret.register.symbol - assert_equal 20612 , @interpreter.get_register(ret.register) + assert_equal 20580 , @interpreter.get_register(ret.register) end def test_sys sys = main_ticks(65) diff --git a/test/risc/position/test_code_position.rb b/test/risc/position/test_code_position.rb index a32e0634..16ae1a2b 100644 --- a/test/risc/position/test_code_position.rb +++ b/test/risc/position/test_code_position.rb @@ -12,11 +12,11 @@ module Risc def test_bin_propagates_existing @binary.extend_to(16) - CodeListener.init( @binary , 0 ) + CodeListener.init( @binary).set(0) assert_equal @binary.padded_length , Position.get(@binary.next).at end def test_bin_propagates_after - CodeListener.init( @binary , 0 ) + CodeListener.init( @binary).set(0) @binary.extend_to(16) assert_equal @binary.padded_length , Position.get(@binary.next).at end diff --git a/test/risc/test_text_writer.rb b/test/risc/test_text_writer.rb index 527a544f..c4407b55 100644 --- a/test/risc/test_text_writer.rb +++ b/test/risc/test_text_writer.rb @@ -32,7 +32,7 @@ module Risc sorted_objects = @text_writer.sorted_objects sorted_objects.each_slice(2) do |l,r| next unless r - assert Position.get(l).at < Position.get(r).at , "#{Position.get(l)} < #{Position.get(r)} , #{l.class}, #{r.class}" + assert Position.get(l).at < Position.get(r).at , "#{Position.get(l)} < #{Position.get(r)} , #{l.object_id.to_s(16)}, #{r.object_id.to_s(16)}" end end def test_sorted_positions2 @@ -40,7 +40,7 @@ module Risc sorted_objects.shift sorted_objects.each_slice(2) do |l,r| next unless r - assert Position.get(l).at < Position.get(r).at , "#{Position.get(l)} < #{Position.get(r)} , #{l.class}, #{r.class}" + assert Position.get(l).at < Position.get(r).at , "#{Position.get(l)} < #{Position.get(r)} , #{l.object_id.to_s(16)}, #{r.object_id.to_s(16)}" end end end