From b0b1bc1684a845ae07df474f6a7e86ada501dadf Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Mon, 25 Jan 2021 14:33:35 -0500 Subject: [PATCH] Tweak ujit disasm output --- ujit.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ujit.rb b/ujit.rb index 8690ffc37a..06de98e7cf 100644 --- a/ujit.rb +++ b/ujit.rb @@ -15,13 +15,13 @@ module UJIT str << "\n" # Sort the blocks by increasing addresses - blocks.sort_by(&:address).each do |block| - str << "== ISEQ RANGE: [#{block.iseq_start_index},#{block.iseq_end_index}[ ".ljust(80, "=") + blocks.sort_by(&:address).each_with_index do |block, i| + str << "== BLOCK #{i+1}/#{blocks.length} ISEQ RANGE: [#{block.iseq_start_index},#{block.iseq_end_index}[ ".ljust(80, "=") str << "\n" cs.disasm(block.code, 0).each do |i| str << sprintf( - "\t%
08X:\t%s\t%
s\n", + " %
08X: %s\t%
s\n", address: block.address + i.address, instruction: i.mnemonic, details: i.op_str