diff options
author | Star Zeng <star.zeng@intel.com> | 2017-05-23 12:28:51 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2017-05-24 15:27:34 +0800 |
commit | 8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff (patch) | |
tree | 57d50b9a23718fa8fabc4b3f6662d02ff2c61974 /MdeModulePkg/Core | |
parent | d727614c913449a59e8333c4d75cff4ebf1f9779 (diff) | |
download | edk2-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/Core')
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c b/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c index 63dcf6e3a1..49eba945fd 100644 --- a/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c +++ b/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c @@ -651,8 +651,12 @@ GetSmmImageDatabaseData ( ImageStruct->EntryPoint = mImageStruct[Index].EntryPoint;
ImageStruct->ImageBase = mImageStruct[Index].ImageBase;
ImageStruct->ImageSize = mImageStruct[Index].ImageSize;
- ImageStruct->PdbStringOffset = sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE);
- CopyMem ((VOID *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset), mImageStruct[Index].PdbString, mImageStruct[Index].PdbStringSize);
+ if (mImageStruct[Index].PdbStringSize != 0) {
+ ImageStruct->PdbStringOffset = sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE);
+ CopyMem ((VOID *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset), mImageStruct[Index].PdbString, mImageStruct[Index].PdbStringSize);
+ } else {
+ ImageStruct->PdbStringOffset = 0;
+ }
ImageStruct = (SMM_CORE_IMAGE_DATABASE_STRUCTURE *)((UINTN)ImageStruct + ImageStruct->Header.Length);
Size += sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + mImageStruct[Index].PdbStringSize;
}
|