バックアップアクセスログの位置がズレることがある不具合を修正、

非正規コマンドによるアクセスを検出するように修正、
最後の正規ROMリードページログの位置がズレることがある不具合を修正

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@578 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
n1481 2011-12-02 08:25:11 +00:00
parent 92ce284969
commit 2a716b133d

View File

@ -14,11 +14,22 @@ my $addr = 0;
my $bkup = 0;
my $line = 0;
my $readcount = 0;
while (<IN>) {
my @data = split /\t/;
$line++;
# pre-read
if ( $step == 0 ) {
$step = 1 if ( $data[2] == 1 && $data[3] == 1 );
if ( $data[2] == 1 && $data[3] == 1 )
{
$step = 1;
if ( $bkup == 1 ) {
print "<<BACKUP ACCESS>>\n" ;
$bkup = 0;
}
}
# backup access
if ( $data[2] == 1 && $data[3] == 0 )
{
@ -27,10 +38,18 @@ while (<IN>) {
}
# read
elsif ( $step == 1 ) {
if ( $data[4] =~ /B7/ ) {
if ( hex($data[4]) == 0xB7 ) {
$step++;
$addr = 0; # initialize
$readcount++;
# printf "READ COMMAND 0x%02x\n", hex($data[4]);
} else {
if( hex($data[4]) != 0xB8 ) { # IDƒŠ<C692>[ƒh
printf "<<INVALID :0x%02x>>\n", hex($data[4]);
printf "Read: 0x%08x-0x%08x (%6d bytes)\n", $start, $start+$size-1, $size if ($start);
$start = 0;
$size = 0;
}
$step = 0; # restart
}
}
@ -38,17 +57,22 @@ while (<IN>) {
elsif ( $step == 2 || $step == 3 || $step == 4 || $step == 5 ) {
$addr = $addr*256 + hex($data[4]);
if ( $step == 5 ) {
if ( $start + $size == $addr && $bkup == 0 ) {
if ( $start + $size == $addr) {
$size += 512;
} else {
printf "Read: 0x%08x-0x%08x (%6d bytes)\n", $start, $start+$size-1, $size if ($start);
$start = $addr;
$size = 512;
if ( $bkup == 1 ) {
print "<<BACKUP ACCESS>>\n" ;
$bkup = 0;
}
}
# $step = 0; # restart
} else {
# $step++;
}
$step++;
}
# dummy access
elsif ( $step == 6 || $step == 7 || $step == 8) {
if ( $step == 8 ) {
$step = 0; # restart
} else {
$step++;
@ -59,7 +83,7 @@ close IN;
if ($start) {
printf "Read: 0x%08x-0x%08x (%6d bytes)\n", $start, $start+$size-1, $size
} else {
} elsif ($readcount == 0) {
printf "Never read.\n";
}
if ( $bkup == 1 ) {