Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
--- a/tools/buildrom.pm Fri Oct 15 14:51:12 2010 +0100
+++ b/tools/buildrom.pm Fri Oct 15 15:50:31 2010 +0100
@@ -1407,9 +1407,19 @@
{
if(AddDllDataInfo($new_line))
{
- $line = "REM $line";
+ # wasn't a valid line, so comment it out
+ $line = "REM $line";
+ }
+ else
+ {
+ # valid patchdata command, retain it for final processing (during reformat_line!)
+ # In expectation that it will be OK later, emit the "REM processed" marker here
+ push @obydata, "REM processed $line";
+ push @obydata, reassert_sourceline();
}
}
+ push @obydata, "$line";
+ next;
}
if($line =~ /^\s*FEATURE\s*(.*)/i || $line =~ /^\s*EXCLUDE_FEATURE\s*(.*)/i)
@@ -3448,7 +3458,7 @@
my $scalarSize;
if(!defined $DllDataMap{$patchdlldatamap_key}->{dstpath}){
- print_source_error(" File $romfilename has not been included into ROM image");
+ print_source_error(" Bad patchdata statement: $romfilename has not been included into ROM image");
$errors++ if($strict);
$line = "REM $line\n";
return $line;
@@ -4422,7 +4432,7 @@
$newVal = $1;
}
else{
- print "ERROR: Invalid patchable value at \"$line\"\n";
+ print_source_error("ERROR: Invalid patchable value : $line");
$errors++ if($strict);
return 1;
}
--- a/tools/filter_obyfile.pl Fri Oct 15 14:51:12 2010 +0100
+++ b/tools/filter_obyfile.pl Fri Oct 15 15:50:31 2010 +0100
@@ -315,9 +315,11 @@
}
# patchdata sys\bin\eiksrv.dll addr 0x0000c944 4 5
- if ($line =~ /^\s*patchdata\s*(\S+)/)
+ # patchdata rawip.dll@KRMtuIPv6 0x578
+ if ($line =~ /^\s*patchdata\s*(\S+)(\s*@|\s+addr)/i)
{
my $romfile = $1;
+ $romfile = "sys\\bin\\$romfile" if ($romfile !~ /\\/);
$romfile =~ s/^\\//; # remove leading \, to match $romfile convention
$romfile = $lc_romfiles{lc $romfile};
--- a/tools/repair_obyfile.pl Fri Oct 15 14:51:12 2010 +0100
+++ b/tools/repair_obyfile.pl Fri Oct 15 15:50:31 2010 +0100
@@ -43,6 +43,12 @@
next; # discard this line - it will be regenerated by the __ECOM_PLUGIN
}
+ if ($line =~ /REM processed \s*patchdata/i)
+ {
+ $line =~ s/REM processed\s+//; # reinstate the original patchdata line
+ my $discarded = <>; # discard the final "patchdata ... addr" line
+ }
+
$line =~ s/REM processed //; # re-enable other directives
if ($line =~ /^time=/)