Revision: 14163
          http://edk2.svn.sourceforge.net/edk2/?rev=14163&view=rev
Author:   oliviermartin
Date:     2013-03-05 23:01:53 +0000 (Tue, 05 Mar 2013)
Log Message:
-----------
ArmPkg/DebugPeCoffExtraActionLib: Checked the ImageContext->PdbPointer is not 
null

This check prevents to get an assertion in case of null PdbPointer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <[email protected]>
Signed-off-by: Olivier Martin <[email protected]>

Modified Paths:
--------------
    
trunk/edk2/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c

Modified: 
trunk/edk2/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c
===================================================================
--- 
trunk/edk2/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c 
    2013-03-05 12:20:53 UTC (rev 14162)
+++ 
trunk/edk2/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c 
    2013-03-05 23:01:53 UTC (rev 14163)
@@ -83,20 +83,24 @@
   CHAR8 Temp[512];
 #endif
 
+  if (ImageContext->PdbPointer) {
 #ifdef __CC_ARM
 #if (__ARMCC_VERSION < 500000)
-  // Print out the command for the RVD debugger to load symbols for this image
-  DEBUG ((EFI_D_ERROR, "load /a /ni /np %a &0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
+    // Print out the command for the RVD debugger to load symbols for this 
image
+    DEBUG ((EFI_D_ERROR, "load /a /ni /np %a &0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
 #else
-  // Print out the command for the DS-5 to load symbols for this image
-  DEBUG ((EFI_D_ERROR, "add-symbol-file %a 0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
+    // Print out the command for the DS-5 to load symbols for this image
+    DEBUG ((EFI_D_ERROR, "add-symbol-file %a 0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
 #endif
 #elif __GNUC__
-  // This may not work correctly if you generate PE/COFF directlyas then the 
Offset would not be required
-  DEBUG ((EFI_D_ERROR, "add-symbol-file %a 0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
+    // This may not work correctly if you generate PE/COFF directlyas then the 
Offset would not be required
+    DEBUG ((EFI_D_ERROR, "add-symbol-file %a 0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
 #else
-  DEBUG ((EFI_D_ERROR, "Loading driver at 0x%11p EntryPoint=0x%11p\n", (VOID 
*)(UINTN) ImageContext->ImageAddress, FUNCTION_ENTRY_POINT 
(ImageContext->EntryPoint)));
+    DEBUG ((EFI_D_ERROR, "Loading driver at 0x%11p EntryPoint=0x%11p\n", (VOID 
*)(UINTN) ImageContext->ImageAddress, FUNCTION_ENTRY_POINT 
(ImageContext->EntryPoint)));
 #endif
+  } else {
+    DEBUG ((EFI_D_ERROR, "Loading driver at 0x%11p EntryPoint=0x%11p\n", (VOID 
*)(UINTN) ImageContext->ImageAddress, FUNCTION_ENTRY_POINT 
(ImageContext->EntryPoint)));
+  }
 }
 
 
@@ -121,15 +125,17 @@
   CHAR8 Temp[512];
 #endif
   
+  if (ImageContext->PdbPointer) {
 #ifdef __CC_ARM
-  {  
-  // Print out the command for the RVD debugger to load symbols for this image
+    // Print out the command for the RVD debugger to load symbols for this 
image
     DEBUG ((EFI_D_ERROR, "unload symbols_only %a\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp))));
-  }
 #elif __GNUC__
-  // This may not work correctly if you generate PE/COFF directlyas then the 
Offset would not be required
-  DEBUG ((EFI_D_ERROR, "remove-symbol-file %a 0x%08x\n", DeCygwinPathIfNeeded 
(ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
+    // This may not work correctly if you generate PE/COFF directlyas then the 
Offset would not be required
+    DEBUG ((EFI_D_ERROR, "remove-symbol-file %a 0x%08x\n", 
DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), 
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
 #else
-  DEBUG ((EFI_D_ERROR, "Unloading %a\n", ImageContext->PdbPointer));
+    DEBUG ((EFI_D_ERROR, "Unloading %a\n", ImageContext->PdbPointer));
 #endif
+  } else {
+    DEBUG ((EFI_D_ERROR, "Unloading driver at 0x%11p\n", (VOID *)(UINTN) 
ImageContext->ImageAddress));
+  }
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to