- PeCoffLoaderGetImageInfo (&ImageContext);\r
- \r
- if (ImageContext.PdbPointer != NULL) {\r
- //\r
- // Copy PDB pointer to AsciiBuffer and replace .PDB with .EFI\r
- //\r
- PdbStr = ImageContext.PdbPointer;\r
- for (Index = 0; PdbStr != 0; Index++, PdbStr++) {\r
- AsciiBuffer[Index] = *PdbStr;\r
- if (*PdbStr == '.') {\r
- AsciiBuffer[Index] = '\0'; \r
+ if (DebugEntry != NULL && DirectoryEntry != NULL) {\r
+ for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount++, DebugEntry++) {\r
+ if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {\r
+ if (DebugEntry->SizeOfData > 0) {\r
+ CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + (UINTN) ImageAddress + (UINTN)TEImageAdjust);\r
+ switch (* (UINT32 *) CodeViewEntryPointer) {\r
+ case CODEVIEW_SIGNATURE_NB10:\r
+ AsciiString = (CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);\r
+ break;\r
+\r
+ case CODEVIEW_SIGNATURE_RSDS:\r
+ AsciiString = (CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);\r
+ break;\r
+\r
+ default:\r
+ AsciiString = NULL;\r
+ break;\r
+ }\r
+ if (AsciiString != NULL) {\r
+ FileNameFound = FALSE;\r
+ for (Index = 0, Index1 = 0; (AsciiString[Index] != 0) && (Index < sizeof (AsciiString)); Index++) {\r
+ if (AsciiString[Index] == '\\') {\r
+ Index1 = Index;\r
+ FileNameFound = TRUE;\r
+ }\r
+ }\r
+\r
+ if (FileNameFound) {\r
+ for (Index = Index1 + 1; AsciiString[Index] != '.'; Index++) {\r
+ AsciiBuffer[Index - (Index1 + 1)] = AsciiString[Index];\r
+ }\r
+ AsciiBuffer[Index - (Index1 + 1)] = 0;\r
+ DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a.efi", AsciiBuffer));\r
+ break;\r
+ }\r
+ }\r
+ }\r