# HG changeset patch # User Ross Qin # Date 1291096798 -28800 # Node ID df89378e92235c3b3496e65bf31ca5b7535a4b3a # Parent 818fe0ed324b109b5b29c617699d8f1f76bf224c Fix these errors: Some cases of PREQ1230 fail because of buildrom issue rombuild crashs when create ext-romimage readimage crashes on reading wk42 vasco_ui core image vc2008 compiling issues diff -r 818fe0ed324b -r df89378e9223 imgtools/buildrom/group/release.txt --- a/imgtools/buildrom/group/release.txt Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/buildrom/group/release.txt Tue Nov 30 13:59:58 2010 +0800 @@ -1,3 +1,8 @@ +Version 3.32.1 (BUILDROM) +=============== +Released by Ross Qin, 30/11/2010 + 1) ou1cimx1#665657 [MCL]Some cases of PREQ1230 fail because of buildrom issue + Version 3.32.0 (BUILDROM) =============== Released by Ross Qin, 18/11/2010 diff -r 818fe0ed324b -r df89378e9223 imgtools/buildrom/tools/buildrom.pm --- a/imgtools/buildrom/tools/buildrom.pm Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/buildrom/tools/buildrom.pm Tue Nov 30 13:59:58 2010 +0800 @@ -642,7 +642,7 @@ } } - # create an oby file by traversing through upated prototype data drive directory. + # create an oby file by traversing through upated prototype data drive directory. &datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist, \@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v ); #reset sisfilepresent flag to zero; @@ -841,7 +841,8 @@ #Set specific platform supplied from the command option elsif($arg =~ /^-D_PLAT=(.*)/) { - $tmpBldRomOpts{"ABI_DIR"} = $1; + $tmpBldRomOpts{"ABI_DIR"} = $1; + } # Check for a Feature Variant elsif ($arg =~ /^-DFEATUREVARIANT=(.*)/) @@ -1223,7 +1224,17 @@ if( $ZDirloc !~ m/:/) { print "drive letter not specified\n"; - $ZDirloc = $thisdir.$ZDirloc; + my $dir = $thisdir ; + my $file = $ZDirloc ; + while( $file =~ /^(\.+\/)(.+)/) { + $file = $2 ; + if( $1 eq "../" ) { + if($dir =~ /(.*[\\\/])([^\\\/]+[\\\/]$)/) { + $dir = $1 ; + } + } + } + $ZDirloc = $dir.$file; } print "Z Drive directory location = $ZDirloc\n"; #set the location of Z Drive directory. @@ -3316,39 +3327,70 @@ { my $what = $1; my $filename = $2; - if ($line =~ /(\S+)\s*=\s*"([^"]+)"/) - { + if ($line =~ /(\S+)\s*=\s*"([^"]+)"/){ $filename = $2; } - my $normedFilename = &get_versionedname($filename); - - # find all the alternative file locations - my @alternatives = fallback($normedFilename); - # test the original location first - unshift(@alternatives, $normedFilename); - - # choose the first file location that actually exists my $fileExists = 0; - foreach my $altFile (@alternatives) - { - my $tmpPath; - my $tmpFile; - if($altFile =~ /"?(.*[\/\\]arm\w+_?\w+)[\/\\]([^"]+)/i) - { - $tmpPath = $1; - $tmpFile = $2; + my $normedFilename = &get_versionedname($filename) ; + my @alternatives = (); + if( $what =~ /data$/i ) { + if(-e $normedFilename) { + $fileExists = $normedFilename ; + } + else { + if($normedFilename =~ /^\s*"?([\\\/]?)([^"]+)"?/i) { + if($1) { + $normedFilename = $epocroot.$2 ; + } + else { + $normedFilename = $2 ; + } + + $fileExists = $normedFilename if(-e $normedFilename); + } + } - $tmpPath .= "\.$varname"; + push @alternatives, $normedFilename; + } + else { + # find all the alternative file locations + @alternatives = fallback($normedFilename); + # test the original location first + unshift(@alternatives, $normedFilename); + + # choose the first file location that actually exists - if (-e $tmpPath ."\/$tmpFile"){ - # SBSv2 variant binary exists - $fileExists = $tmpPath . "\/$tmpFile"; + foreach my $altFile (@alternatives) { + my $tmpFile = ""; + + next if($altFile eq ""); + if($altFile =~/^\s*"?([\\\/]?)([^"]+)"?/i ) { + if($1) { + $altFile = $epocroot.$2 ; + } + else { + $altFile = $2 ; + } + } + + if($altFile =~ /(.*[\/\\]arm\w+_?\w+)[\/\\](.+)/i) { + $tmpFile = $1."\.$varname\/".$2; + } + else { + $tmpFile = $altFile; + } + + if (-e $tmpFile){ + # SBSv2 variant binary exists + $fileExists = $tmpFile; + } + else { + # SBSv1 variant binary or invariant binary + $fileExists = get_BVbinname($altFile, $varname); + } + last if $fileExists; + } - else { - # SBSv1 variant binary or invariant binary - $fileExists = get_BVbinname($altFile, $varname); - } - last if $fileExists; } # edit the OBY line to use the actual file name which we found. diff -r 818fe0ed324b -r df89378e9223 imgtools/imglib/symbolutil/logparser.cpp --- a/imgtools/imglib/symbolutil/logparser.cpp Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/imglib/symbolutil/logparser.cpp Tue Nov 30 13:59:58 2010 +0800 @@ -30,7 +30,8 @@ LogParser* LogParser::Only = (LogParser*)0; -LogParser* LogParser::GetInstance(TImageType aImageType) throw (LoggingException) + +LogParser* LogParser::GetInstance(TImageType aImageType) throw (LOGGINGEXCEPTION) { if(! LogParser::Only) { @@ -69,8 +70,8 @@ { iImageType = ERofsImage; } - -void RofsLogParser::ParseSymbol(const char* LogFilename) throw (LoggingException) + +void RofsLogParser::ParseSymbol(const char* LogFilename) throw (LOGGINGEXCEPTION) { string linebuf; SymbolGenerator* symgen = SymbolGenerator::GetInstance(); @@ -124,7 +125,7 @@ iImageType = ERomImage; } -void RomLogParser::ParseSymbol(const char* LogFilename) throw (LoggingException) +void RomLogParser::ParseSymbol(const char* LogFilename) throw (LOGGINGEXCEPTION) { string linebuf; SymbolGenerator* symgen = SymbolGenerator::GetInstance(); @@ -150,53 +151,53 @@ while(getline(logfd, tmpline)) { TPlacedEntry tmpEntry; - if(regex_search(tmpline, what, endFlag)) + if(regex_search(tmpline.c_str(), what, endFlag)) { break; } - if(regex_search(tmpline, what, sourceFile)) + if(regex_search(tmpline.c_str(), what, sourceFile)) { tmpEntry.iFileName.assign(what[1].first, what[1].second-what[1].first); tmpaddr.assign(what[2].first, what[2].second-what[2].first); tmpEntry.iDataAddress = strtol(tmpaddr.c_str(), NULL, 16); symgen->AddEntry(tmpEntry); } - else if(regex_search(tmpline, what, executableFile)) + else if(regex_search(tmpline.c_str(), what, executableFile)) { tmpEntry.iFileName.assign(what[1].first, what[1].second-what[1].first); while(getline(logfd, tmpline) && tmpline != "") { - if(regex_search(tmpline, what, codeStart)) + if(regex_search(tmpline.c_str(), what, codeStart)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iCodeAddress = strtol(tmpaddr.c_str(), NULL, 16); } - else if(regex_search(tmpline, what, dataStart)) + else if(regex_search(tmpline.c_str(), what, dataStart)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iDataAddress = strtol(tmpaddr.c_str(), NULL, 16); } - else if(regex_search(tmpline, what, dataBssStart)) + else if(regex_search(tmpline.c_str(), what, dataBssStart)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iDataBssLinearBase = strtol(tmpaddr.c_str(), NULL, 16); } - else if(regex_search(tmpline, what, textSize)) + else if(regex_search(tmpline.c_str(), what, textSize)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iTextSize = strtol(tmpaddr.c_str(), NULL, 16); } - else if(regex_search(tmpline, what, dataSize)) + else if(regex_search(tmpline.c_str(), what, dataSize)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iDataSize = strtol(tmpaddr.c_str(), NULL, 16); } - else if(regex_search(tmpline, what, bssSize)) + else if(regex_search(tmpline.c_str(), what, bssSize)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iBssSize = strtol(tmpaddr.c_str(), NULL, 16); } - else if(regex_search(tmpline, what, totalDataSize)) + else if(regex_search(tmpline.c_str(), what, totalDataSize)) { tmpaddr.assign(what[1].first, what[1].second-what[1].first); tmpEntry.iTotalDataSize = strtol(tmpaddr.c_str(), NULL, 16); diff -r 818fe0ed324b -r df89378e9223 imgtools/imglib/symbolutil/logparser.h --- a/imgtools/imglib/symbolutil/logparser.h Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/imglib/symbolutil/logparser.h Tue Nov 30 13:59:58 2010 +0800 @@ -21,16 +21,21 @@ #include "loggingexception.h" #include "symbolgenerator.h" - +#ifdef _MSC_VER +#define LOGGINGEXCEPTION ... +#else +#define LOGGINGEXCEPTION LoggingException +#endif /** * @class LogParser */ class LogParser { public: - static LogParser* GetInstance(TImageType aImageType) throw (LoggingException); - - virtual void ParseSymbol(const char* LogFilename) throw (LoggingException) = 0; + + static LogParser* GetInstance(TImageType aImageType) throw (LOGGINGEXCEPTION); + virtual void ParseSymbol(const char* LogFilename) throw (LOGGINGEXCEPTION) = 0; + void Cleanup(void); virtual ~LogParser() {} @@ -47,14 +52,14 @@ class RofsLogParser : public LogParser { public: - virtual void ParseSymbol(const char* LogFilename) throw (LoggingException); + virtual void ParseSymbol(const char* LogFilename) throw (LOGGINGEXCEPTION); RofsLogParser(void); }; class RomLogParser : public LogParser { public: - virtual void ParseSymbol(const char* LogFilename) throw (LoggingException); + virtual void ParseSymbol(const char* LogFilename) throw (LOGGINGEXCEPTION); RomLogParser(void); }; diff -r 818fe0ed324b -r df89378e9223 imgtools/imglib/symbolutil/symbolprocessunit.cpp --- a/imgtools/imglib/symbolutil/symbolprocessunit.cpp Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/imglib/symbolutil/symbolprocessunit.cpp Tue Nov 30 13:59:58 2010 +0800 @@ -20,7 +20,9 @@ #include "symbolgenerator.h" #include "h_utl.h" - +#ifdef _MSC_VER +#define snprintf _snprintf +#endif #define MAX_LINE 65535 #if defined(__LINUX__) @@ -536,10 +538,10 @@ boost::regex regARMV5("ARMV5", boost::regex::icase); boost::regex regGCCEoARMV4("(GCCE|ARMV4)", boost::regex::icase); boost::cmatch what; - if(regex_search(aFile, what, regARMV5)) { + if(regex_search(aFile.c_str(), what, regARMV5)) { ProcessArmv5File(aFile, fMap); } - else if(regex_search(aFile, what, regGCCEoARMV4)) { + else if(regex_search(aFile.c_str(), what, regGCCEoARMV4)) { ProcessGcceOrArm4File(aFile, fMap); } else { @@ -676,13 +678,13 @@ break; else if(regex_search(str, what, reg1)) { sLibFile.assign(what[4].first,what[4].second-what[4].first); - if(!regex_search(sLibFile, what1, reg)) { + if(!regex_search(sLibFile.c_str(), what1, reg)) { sTmp.assign(what[2].first,what[2].second-what[2].first); addr = strtol(sTmp.c_str(), NULL, 16); sTmp.assign(what[3].first,what[3].second-what[3].first); len = strtol(sTmp.c_str(), NULL, 16); syms[addr+len] = ""; - if(regex_search(sLibFile, what, reg3)) { + if(regex_search(sLibFile.c_str(), what, reg3)) { stubhex = addr; } } @@ -778,10 +780,10 @@ boost::regex regARMV5("ARMV5", boost::regex::icase); boost::regex regGCCEoARMV4("(GCCE|ARMV4)", boost::regex::icase); boost::cmatch what; - if(regex_search(aFile, what, regARMV5)) { + if(regex_search(aFile.c_str(), what, regARMV5)) { ProcessArmv5File(aFile, fMap); } - else if(regex_search(aFile, what, regGCCEoARMV4)) { + else if(regex_search(aFile.c_str(), what, regGCCEoARMV4)) { ProcessGcceOrArm4File(aFile, fMap); } else { @@ -879,7 +881,7 @@ if( (syms.find(k) == syms.end()) || size != 0) { TSymbolPCEntry tmpEntry; - if(regex_search(sSym, what, regScope)) + if(regex_search(sSym.c_str(), what, regScope)) { scopeName.assign(what[1].first, what[1].second-what[1].first); symName.assign(what[2].first, what[2].second-what[2].first); @@ -962,13 +964,13 @@ break; else if(regex_search(str, what, reg1)) { sLibFile.assign(what[4].first,what[4].second-what[4].first); - if(!regex_search(sLibFile, what1, reg)) { + if(!regex_search(sLibFile.c_str(), what1, reg)) { sTmp.assign(what[2].first,what[2].second-what[2].first); addr = strtol(sTmp.c_str(), NULL, 16); sTmp.assign(what[3].first,what[3].second-what[3].first); len = strtol(sTmp.c_str(), NULL, 16); syms[addr+len] = ""; - if(regex_search(sLibFile, what, reg3)) { + if(regex_search(sLibFile.c_str(), what, reg3)) { stubhex = addr; } } diff -r 818fe0ed324b -r df89378e9223 imgtools/romtools/group/release.txt --- a/imgtools/romtools/group/release.txt Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/romtools/group/release.txt Tue Nov 30 13:59:58 2010 +0800 @@ -1,4 +1,13 @@ - +Version 2.19.1 (ROMBUILD) +=============== +Released by Ross Qin, 30/11/2010 + 1) ou1cimx1#653168 - rombuild crashs when create ext-romimage + +Version 2.2 build(3) (readimage) +=============== +Released by Ross Qin, 30/11/2010 + 1) ou1cimx1#651824 - [MCL]readimage crashes on reading wk42 vasco_ui core image + Version 2.19.0 (ROMBUILD) =============== Released by Marvin Shi, 17/11/2010 diff -r 818fe0ed324b -r df89378e9223 imgtools/romtools/group/rofsbuild.vcproj --- a/imgtools/romtools/group/rofsbuild.vcproj Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/romtools/group/rofsbuild.vcproj Tue Nov 30 13:59:58 2010 +0800 @@ -43,7 +43,7 @@ - - @@ -373,6 +369,30 @@ > + + + + + + + + + + + + + + + + + + + + + + + + diff -r 818fe0ed324b -r df89378e9223 imgtools/romtools/group/rombuild.vcproj --- a/imgtools/romtools/group/rombuild.vcproj Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/romtools/group/rombuild.vcproj Tue Nov 30 13:59:58 2010 +0800 @@ -43,7 +43,7 @@ - - @@ -345,6 +341,30 @@ > + + + + + + + + + + + + + + + + + + + + + + + + diff -r 818fe0ed324b -r df89378e9223 imgtools/romtools/readimage/src/image_handler.cpp --- a/imgtools/romtools/readimage/src/image_handler.cpp Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/romtools/readimage/src/image_handler.cpp Tue Nov 30 13:59:58 2010 +0800 @@ -26,7 +26,12 @@ #include "rom_image_reader.h" #include "e32_image_reader.h" #include "e32rom.h" -#include "h_ver.h" + +const TInt MajorVersion=2; +const TInt MinorVersion=2; +const TInt Build=3; +const char Copyright[]="Copyright (c) 1996-2010 Nokia Corporation.\n\n"; + #include "sis2iby.h" #include diff -r 818fe0ed324b -r df89378e9223 imgtools/romtools/readimage/src/rom_image_reader.cpp --- a/imgtools/romtools/readimage/src/rom_image_reader.cpp Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/romtools/readimage/src/rom_image_reader.cpp Tue Nov 30 13:59:58 2010 +0800 @@ -568,12 +568,18 @@ DumpInHex("Stack size", aRomImgEntry->iStackSize) << endl; TDllRefTable *aRefTbl = NULL; - - if( aRomImgEntry->iDllRefTable ) { - TUint32 aOff = (TUint32)aRomImgEntry->iDllRefTable - iImageHeader->iRomHdr->iRomBase; - aRefTbl = (TDllRefTable*) ((char*)iImageHeader->iRomHdr + aOff); - TUint32 aVirtualAddr = (TUint32)aRefTbl->iEntry[0]; - DumpInHex("Dll ref table", aVirtualAddr) << endl; + + if( aRomImgEntry->iDllRefTable ) { + TUint32 aOff = (TUint32)aRomImgEntry->iDllRefTable - iImageHeader->iRomHdr->iRomBase; + if(static_cast(aOff) > 0) { + aRefTbl = (TDllRefTable*) (iRomLayoutData + aOff); + TUint32 aVirtualAddr = reinterpret_cast(aRefTbl->iEntry[0]); + DumpInHex("Dll ref table", aVirtualAddr) << endl; + + } + else { + DumpInHex("Error Dll ref table", 0) << endl; + } } DumpInHex("Export directory", aRomImgEntry->iExportDir) << endl; @@ -607,11 +613,13 @@ if(stricmp(iE32ImgFileName.c_str(), aEntry->Name()) == 0){ TUint aSectionOffset = aRomImgEntry->iCodeAddress - iImageHeader->iRomHdr->iRomBase; TUint* aCodeSection = (TUint*)((char*)iImageHeader->iRomHdr + aSectionOffset); + //TUint* aCodeSection = (TUint*)(iRomLayoutData + aSectionOffset); *out << "\nCode (Size=0x" << hex << aRomImgEntry->iCodeSize << ")" << endl; DumpData(aCodeSection, aRomImgEntry->iCodeSize); aSectionOffset = aRomImgEntry->iDataAddress - iImageHeader->iRomHdr->iRomBase; TUint* aDataSection = (TUint*)((char*)iImageHeader->iRomHdr + aSectionOffset); + //TUint* aDataSection = (TUint*)(iRomLayoutData + aSectionOffset); if( aRomImgEntry->iDataSize){ *out << "\nData (Size=0x" << hex << aRomImgEntry->iDataSize << ")" << endl; DumpData(aDataSection, aRomImgEntry->iDataSize); diff -r 818fe0ed324b -r df89378e9223 imgtools/romtools/rombuild/rombuild.cpp --- a/imgtools/romtools/rombuild/rombuild.cpp Thu Nov 18 16:02:32 2010 +0800 +++ b/imgtools/romtools/rombuild/rombuild.cpp Tue Nov 30 13:59:58 2010 +0800 @@ -34,7 +34,7 @@ static const TInt RombuildMajorVersion=2; static const TInt RombuildMinorVersion=19; -static const TInt RombuildPatchVersion=0; +static const TInt RombuildPatchVersion=1; static TBool SizeSummary=EFalse; static TPrintType SizeWhere=EAlways; static string compareROMName = ""; @@ -589,15 +589,21 @@ } if(gGenInc) { - Print(EAlways,"Generating include file for ROM image post-processors "); - if( gPagedRom ) { - Print(EAlways,"Paged ROM"); - GenerateIncludeFile((char*)mainObeyFile->iRomFileName, kernelRom->iHeader->iPageableRomStart, kernelRom->iHeader->iPageableRomSize); + + if(kernelRom != NULL) { + Print(EAlways,"Generating include file for ROM image post-processors "); + if( gPagedRom ) { + Print(EAlways,"Paged ROM"); + GenerateIncludeFile((char*)mainObeyFile->iRomFileName, kernelRom->iHeader->iPageableRomStart, kernelRom->iHeader->iPageableRomSize); + } + else { + Print(EAlways,"Unpaged ROM"); + int headersize=(kernelRom->iExtensionRomHeader ? sizeof(TExtensionRomHeader) : sizeof(TRomHeader)) - sizeof(TRomLoaderHeader); + GenerateIncludeFile((char*)mainObeyFile->iRomFileName, kernelRom->iHeader->iCompressedSize + headersize, kernelRom->iHeader->iPageableRomSize); + } } else { - Print(EAlways,"Unpaged ROM"); - int headersize=(kernelRom->iExtensionRomHeader ? sizeof(TExtensionRomHeader) : sizeof(TRomHeader)) - sizeof(TRomLoaderHeader); - GenerateIncludeFile((char*)mainObeyFile->iRomFileName, kernelRom->iHeader->iCompressedSize + headersize, kernelRom->iHeader->iPageableRomSize); + Print(EWarning,"Generating include file for ROM image igored because no Core ROM image generated.\n"); } }