DEBUG ((EFI_D_ERROR, "\n %a \n", Message));\r
}\r
\r
+#ifndef MDEPKG_NDEBUG\r
+STATIC\r
+CONST CHAR8 *\r
+BaseName (\r
+ IN CONST CHAR8 *FullName\r
+ )\r
+{\r
+ CONST CHAR8 *Str;\r
+\r
+ Str = FullName + AsciiStrLen (FullName);\r
+\r
+ while (--Str > FullName) {\r
+ if (*Str == '/' || *Str == '\\') {\r
+ return Str + 1;\r
+ }\r
+ }\r
+ return Str;\r
+}\r
+#endif\r
+\r
/**\r
This is the default action to take on an unexpected exception\r
\r
\r
Pdb = GetImageName (SystemContext.SystemContextAArch64->ELR, &ImageBase, &PeCoffSizeOfHeader);\r
if (Pdb != NULL) {\r
- DEBUG ((EFI_D_ERROR, "%a loaded at 0x%016lx \n", Pdb, ImageBase));\r
+ DEBUG ((EFI_D_ERROR, "%a loaded at 0x%016lx \n", BaseName (Pdb), ImageBase));\r
\r
Pdb = GetImageName (SystemContext.SystemContextAArch64->LR, &ImageBase,\r
&PeCoffSizeOfHeader);\r
if (Pdb != NULL) {\r
DEBUG ((EFI_D_ERROR, "called from %a (0x%016lx) loaded at 0x%016lx \n",\r
- Pdb, SystemContext.SystemContextAArch64->LR, ImageBase));\r
+ BaseName (Pdb), SystemContext.SystemContextAArch64->LR, ImageBase));\r
}\r
for (Fp = (UINT64 *)SystemContext.SystemContextAArch64->FP;\r
*Fp != 0;\r
Pdb = GetImageName (Fp[1], &ImageBase, &PeCoffSizeOfHeader);\r
if (Pdb != NULL) {\r
DEBUG ((EFI_D_ERROR, "called from %a (0x%016lx) loaded at 0x%016lx \n",\r
- Pdb, Fp[1], ImageBase));\r
+ BaseName (Pdb), Fp[1], ImageBase));\r
}\r
}\r
}\r