diff options
author | Sandeep Nair | 2010-11-28 11:25:38 -0600 |
---|---|---|
committer | Sandeep Nair | 2010-11-28 11:25:38 -0600 |
commit | 926af2e4f85e4b5cab41ddff06863575d6cd3b79 (patch) | |
tree | 181a4f645d49c3488b87f812cb2235cd2ce7f0a6 | |
parent | bbb2d965aa7c27a0956887693fec90a4358afe90 (diff) | |
download | mad-utils-926af2e4f85e4b5cab41ddff06863575d6cd3b79.tar.gz mad-utils-926af2e4f85e4b5cab41ddff06863575d6cd3b79.tar.xz mad-utils-926af2e4f85e4b5cab41ddff06863575d6cd3b79.zip |
Added debug output to map tool
-rwxr-xr-x | map-tool/maptool.py | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/map-tool/maptool.py b/map-tool/maptool.py index 3f1306a..1fe3e98 100755 --- a/map-tool/maptool.py +++ b/map-tool/maptool.py | |||
@@ -501,6 +501,7 @@ class mapToolCfg: | |||
501 | __nmlLoader = None | 501 | __nmlLoader = None |
502 | __prelinkCmdFileName = None | 502 | __prelinkCmdFileName = None |
503 | __imageDir = None | 503 | __imageDir = None |
504 | __fsOffsetsFileName = None | ||
504 | 505 | ||
505 | def __init__(self,cfgFile): | 506 | def __init__(self,cfgFile): |
506 | self.__cfgFilename = cfgFile | 507 | self.__cfgFilename = cfgFile |
@@ -508,6 +509,7 @@ class mapToolCfg: | |||
508 | self.__activationRecordsDir = './tmp/ar' | 509 | self.__activationRecordsDir = './tmp/ar' |
509 | self.__fileSystemDir = './tmp/fs' | 510 | self.__fileSystemDir = './tmp/fs' |
510 | self.__imageDir = './images' | 511 | self.__imageDir = './images' |
512 | self.__fsOffsetsFileName = os.path.join('./tmp', 'fsOffsets.txt') | ||
511 | if not os.path.exists(self.__activationRecordsDir): | 513 | if not os.path.exists(self.__activationRecordsDir): |
512 | os.makedirs(self.__activationRecordsDir) | 514 | os.makedirs(self.__activationRecordsDir) |
513 | if not os.path.exists(self.__fileSystemDir): | 515 | if not os.path.exists(self.__fileSystemDir): |
@@ -542,6 +544,9 @@ class mapToolCfg: | |||
542 | def getPrelinkCmdFileName(self): | 544 | def getPrelinkCmdFileName(self): |
543 | return self.__prelinkCmdFileName | 545 | return self.__prelinkCmdFileName |
544 | 546 | ||
547 | def getfsOffsetsFileName(self): | ||
548 | return self.__fsOffsetsFileName | ||
549 | |||
545 | # Parse the MAP tool configuration file | 550 | # Parse the MAP tool configuration file |
546 | def parseFile(self): | 551 | def parseFile(self): |
547 | if os.path.isfile(self.__cfgFilename) != True: | 552 | if os.path.isfile(self.__cfgFilename) != True: |
@@ -852,6 +857,14 @@ class fileSystem: | |||
852 | f.dump() | 857 | f.dump() |
853 | print'' | 858 | print'' |
854 | 859 | ||
860 | def dumpFileoffsets(self, outFname): | ||
861 | __fContent = [] | ||
862 | for __file in self.fileList: | ||
863 | __offset = __file.getFileOffset() | ||
864 | __offsetStr = __file.getName() + ':' + '\t' + dec2hex(__offset) | ||
865 | __fContent.append(__offsetStr) | ||
866 | writeFile(outFname, __fContent) | ||
867 | |||
855 | def genFsImage(self, outFileName): | 868 | def genFsImage(self, outFileName): |
856 | # Run the filesystem generator | 869 | # Run the filesystem generator |
857 | genRomFs(outFileName, self.rootDir, 'MadLoadImage', self.__fsGenList) | 870 | genRomFs(outFileName, self.rootDir, 'MadLoadImage', self.__fsGenList) |
@@ -2000,6 +2013,7 @@ ofdTool = mapCfg.getOfdTool() | |||
2000 | malLoader = mapCfg.getMalLoader() | 2013 | malLoader = mapCfg.getMalLoader() |
2001 | nmlLoader = mapCfg.getNmlLoader() | 2014 | nmlLoader = mapCfg.getNmlLoader() |
2002 | prelinkCmdFileName = mapCfg.getPrelinkCmdFileName() | 2015 | prelinkCmdFileName = mapCfg.getPrelinkCmdFileName() |
2016 | fsOffsetsFileName = mapCfg.getfsOffsetsFileName() | ||
2003 | 2017 | ||
2004 | dc = deploymentConfig(deploymentCfgFile) | 2018 | dc = deploymentConfig(deploymentCfgFile) |
2005 | if (dc.parseFile() != 0): | 2019 | if (dc.parseFile() != 0): |
@@ -2176,24 +2190,27 @@ errorCode = genAppDeploymentFileBin(dList, loadImageFs2) | |||
2176 | # Generate Filesystem Image | 2190 | # Generate Filesystem Image |
2177 | loadImageFs2.genFsImage(LoadImageName) | 2191 | loadImageFs2.genFsImage(LoadImageName) |
2178 | 2192 | ||
2193 | # Write out file offsets in the file systems | ||
2194 | loadImageFs2.dumpFileoffsets(fsOffsetsFileName) | ||
2195 | |||
2179 | if errorCode != None: | 2196 | if errorCode != None: |
2180 | sys.exit(-10) | 2197 | sys.exit(-10) |
2181 | 2198 | ||
2182 | # Debug Dumps | 2199 | # Debug Dumps |
2183 | # Print Partition List | 2200 | # Print Partition List |
2184 | for p in pList: | 2201 | #for p in pList: |
2185 | p.dump() | 2202 | # p.dump() |
2186 | 2203 | ||
2187 | # Print Application List | 2204 | # Print Application List |
2188 | for a in aList: | 2205 | #for a in aList: |
2189 | a.dump() | 2206 | # a.dump() |
2190 | 2207 | ||
2191 | # Print Library List | 2208 | # Print Library List |
2192 | print 'Printing globalLibList:' | 2209 | #print 'Printing globalLibList:' |
2193 | for lib in globalLibList: | 2210 | #for lib in globalLibList: |
2194 | globalLibList[lib].dump() | 2211 | # globalLibList[lib].dump() |
2195 | 2212 | ||
2196 | # Print FileSystem Info | 2213 | # Print FileSystem Info |
2197 | print 'Print Filesystem Information:' | 2214 | #print 'Print Filesystem Information:' |
2198 | #loadImageFs.dump() | 2215 | #loadImageFs.dump() |
2199 | loadImageFs2.dump() \ No newline at end of file | 2216 | #loadImageFs2.dump() \ No newline at end of file |