Fixed issue with new MAP file feature a fprintf was using a pointer to the .PDB file that was in data that had been freed. Moved the fprint before the free and also print out if the image is PE32 or TE now in the map file.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1241 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ajfish 2006-08-11 18:08:43 +00:00
parent 317f832ef8
commit 396974d645
1 changed files with 25 additions and 12 deletions

View File

@ -706,6 +706,18 @@ Returns:
memcpy (CurrentPe32Section.Pe32Section + 1, (VOID *) MemoryImagePointerAligned, (UINT32) ImageSize);
//
// If a map file was selected output mapping information for any file that
// was rebased.
//
if (MapFile != NULL) {
fprintf (MapFile, "PE32 File: %s Base:%08lx", FileGuidString, BaseAddress);
if (ImageContext.PdbPointer != NULL) {
fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
}
fprintf (MapFile, "\n");
}
free ((VOID *) MemoryImagePointer);
//
@ -929,6 +941,19 @@ Returns:
GetLength (CurrentPe32Section.Pe32Section->CommonHeader.Size) - sizeof (EFI_PE32_SECTION) -
sizeof (EFI_TE_IMAGE_HEADER)
);
//
// If a map file was selected output mapping information for any file that
// was rebased.
//
if (MapFile != NULL) {
fprintf (MapFile, "TE File: %s Base:%08lx", FileGuidString, BaseAddress);
if (ImageContext.PdbPointer != NULL) {
fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
}
fprintf (MapFile, "\n");
}
free ((VOID *) MemoryImagePointer);
free (TEBuffer);
if (FfsFile->Attributes & FFS_ATTRIB_TAIL_PRESENT) {
@ -972,18 +997,6 @@ Returns:
return EFI_NOT_FOUND;
}
}
//
// If a map file was selected output mapping information for any file that
// was rebased.
//
if (MapFile != NULL) {
fprintf (MapFile, "File: %s Base:%08lx", FileGuidString, BaseAddress);
if (ImageContext.PdbPointer != NULL) {
fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
}
fprintf (MapFile, "\n");
}
return EFI_SUCCESS;
}