summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-05-23 12:28:51 +0800
committerStar Zeng <star.zeng@intel.com>2017-05-24 15:27:34 +0800
commit8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff (patch)
tree57d50b9a23718fa8fabc4b3f6662d02ff2c61974 /MdeModulePkg/Application
parentd727614c913449a59e8333c4d75cff4ebf1f9779 (diff)
downloadedk2-8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff.tar.gz
edk2-8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff.tar.bz2
edk2-8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff.zip
MdeModulePkg SmiHandlerProfile: Fix no PDB case handling incorrectly
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=569 The PdbStringOffset should be set to 0 for no PDB case, then SmiHandlerProfileInfo can use it to know whether there is PCD info or not. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c
index 2419cd2959..338671374c 100644
--- a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c
+++ b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c
@@ -266,8 +266,8 @@ GetDriverNameString (
//
// Method 1: Get the name string from image PDB
//
- if (ImageStruct->Header.Length > sizeof (SMM_CORE_IMAGE_DATABASE_STRUCTURE)) {
- GetShortPdbFileName ((CHAR8 *) (ImageStruct + 1), mNameString);
+ if (ImageStruct->PdbStringOffset != 0) {
+ GetShortPdbFileName ((CHAR8 *) ((UINTN) ImageStruct + ImageStruct->PdbStringOffset), mNameString);
return mNameString;
}
@@ -355,8 +355,10 @@ DumpSmmLoadedImage(
Print(L" FvFile=\"%g\"", &ImageStruct->FileGuid);
Print(L" RefId=\"0x%x\"", ImageStruct->ImageRef);
Print(L">\n");
- PdbString = (CHAR8 *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset);
- Print(L" <Pdb>%a</Pdb>\n", PdbString);
+ if (ImageStruct->PdbStringOffset != 0) {
+ PdbString = (CHAR8 *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset);
+ Print(L" <Pdb>%a</Pdb>\n", PdbString);
+ }
Print(L" </Image>\n");
}