1. Print VTF file offset info
authorqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Thu, 11 Feb 2010 06:18:05 +0000 (06:18 +0000)
committerqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Thu, 11 Feb 2010 06:18:05 +0000 (06:18 +0000)
2. Sort the module list according to their offset in FV

git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1863 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/C/GenFv/GenFvInternalLib.c
Source/Python/build/BuildReport.py

index c7c3257..7549810 100644 (file)
@@ -1082,6 +1082,10 @@ Returns:
       // copy VTF File\r
       //\r
       memcpy (*VtfFileImage, FileBuffer, FileSize);\r
+      \r
+      PrintGuidToBuffer ((EFI_GUID *) FileBuffer, FileGuidString, sizeof (FileGuidString), TRUE); \r
+      fprintf (FvReportFile, "0x%08X %s\n", (unsigned) ((UINT8 *)(*VtfFileImage) - FvImage->FileImage), FileGuidString);\r
+\r
       free (FileBuffer);\r
       DebugMsg (NULL, 0, 9, "Add VTF FFS file in FV image", NULL);\r
       return EFI_SUCCESS;\r
@@ -1118,7 +1122,7 @@ Returns:
     //\r
     memcpy (FvImage->CurrentFilePointer, FileBuffer, FileSize);\r
     PrintGuidToBuffer ((EFI_GUID *) FileBuffer, FileGuidString, sizeof (FileGuidString), TRUE); \r
-    fprintf (FvReportFile, "0x%08x %s\n", (unsigned) (FvImage->CurrentFilePointer - FvImage->FileImage), FileGuidString);\r
+    fprintf (FvReportFile, "0x%08X %s\n", (unsigned) (FvImage->CurrentFilePointer - FvImage->FileImage), FileGuidString);\r
     FvImage->CurrentFilePointer += FileSize;\r
   } else {\r
     Error (NULL, 0, 4002, "Resource", "FV space is full, cannot add file %s.", FvInfo->FvFiles[Index]);\r
index 12eaf48..0154706 100755 (executable)
@@ -1186,10 +1186,14 @@ class FdRegionReport(object):
                 #
                 # Write module offset and module identification to the report file.
                 #
+                OffsetInfo = {}
                 for Match in gOffsetGuidPattern.finditer(FvReport):
                     Guid = Match.group(2).upper()
-                    Offset = int(Match.group(1), 16)
-                    FileWrite (File, "0x%07X %s" % (Offset, self._GuidsDb.get(Guid, Guid)))
+                    OffsetInfo[Match.group(1)] = self._GuidsDb.get(Guid, Guid)
+                OffsetList = OffsetInfo.keys()
+                OffsetList.sort()
+                for Offset in OffsetList:
+                    FileWrite (File, "%s %s" % (Offset, OffsetInfo[Offset]))
             except IOError:
                 EdkLogger.warn(None, "Fail to read report file", FvReportFileName)
         else: