view logs2.pl @ 8:3525971010e4

use FindBin for perlscirpts
author anatofuz
date Mon, 05 Nov 2018 16:44:49 +0900
parents b9a157e11952
children 1fda58f3b60f
line wrap: on
line source

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/lib";
use OPCODE2Function;

my $originlog = shift or die "use originlog cbclog";
my $cbclog = shift or die "use originlog cbclog";

open my $ofh, '<', $originlog;
open my $cfh, '<', $cbclog;

print "Originlog:CbClog\n";

while (1){
  my $orig_line;
  do  {
     $orig_line = <$ofh>;
  } while (!($orig_line =~ /\$\d+ \= (\d+)/));

  $orig_line = $1;

  my $c_line;

  do {
     $c_line = <$cfh>;
  } while (!($c_line !~ /\$\d+ \= (\d+)/));

  $c_line = $1;

  if ($c_line != $orig_line){
	  print "*";
	  print "$orig_line : $c_line\n";
      print OPCODE2Function->codes($orig_line) ,":", OPCODE2Function->codes($c_line) ,"\n";
	  exit 0;
  }

  print "$orig_line : $c_line\n";
  print OPCODE2Function->codes($orig_line) ,":", OPCODE2Function->codes($c_line) ,"\n";

}