]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: DebugAssert enhancement
authorBaraneedharan Anbazhagan <anbazhagan@hp.com>
Mon, 7 Dec 2015 03:06:02 +0000 (03:06 +0000)
committerlgao4 <lgao4@Edk2>
Mon, 7 Dec 2015 03:06:02 +0000 (03:06 +0000)
If the assert happens in a library, then it's hard to determine which
module using that library is generating that assert.  Use gEfiCallerBaseName
in DebugAssert to display the module name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19127 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
MdePkg/Library/UefiDebugLibConOut/DebugLib.c
MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
MdePkg/Library/UefiDebugLibStdErr/DebugLib.c

index 6fa235c2af0cd581780fde85a2a9c3d033a6085e..8ab084721e9332b601591ec4dfb2793ac7cbf966 100644 (file)
@@ -133,7 +133,7 @@ DebugAssert (
   //\r
   // Generate the ASSERT() message in Ascii format\r
   //\r
-  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT %a(%d): %a\n", FileName, LineNumber, Description);\r
+  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT [%a] %a(%d): %a\n", gEfiCallerBaseName, FileName, LineNumber, Description);\r
 \r
   //\r
   // Send the print string to the Console Output device\r
index 2ac2204e1d4b11d8bbca5d3094ac3614ccdc9600..0bc112fd1b6f5ba17f37b1805459e93721acad6d 100644 (file)
@@ -121,7 +121,8 @@ DebugAssert (
   UnicodeSPrintAsciiFormat (\r
     Buffer, \r
     sizeof (Buffer), \r
-    "ASSERT %a(%d): %a\n", \r
+    "ASSERT [%a] %a(%d): %a\n",\r
+    gEfiCallerBaseName,\r
     FileName, \r
     LineNumber, \r
     Description\r
index 10d3e347ccc659e9a8659915a8610e8c1d64c203..44bf6ba128a5aa57f4ed55ca6975f7385c599953 100644 (file)
@@ -175,7 +175,8 @@ DebugAssert (
   AsciiSPrint (\r
     Buffer, \r
     sizeof (Buffer), \r
-    "ASSERT %a(%d): %a\n", \r
+    "ASSERT [%a] %a(%d): %a\n",\r
+    gEfiCallerBaseName,\r
     FileName, \r
     LineNumber, \r
     Description\r
index bbd6d946444d4672d2c39d87741930c665c03441..cacb90a2442a2c722f6c8b17de399d7f1707c371 100644 (file)
@@ -122,7 +122,8 @@ DebugAssert (
   UnicodeSPrintAsciiFormat (\r
     Buffer, \r
     sizeof (Buffer),\r
-    "ASSERT %a(%d): %a\n", \r
+    "ASSERT [%a] %a(%d): %a\n",\r
+    gEfiCallerBaseName,\r
     FileName, \r
     LineNumber, \r
     Description\r