From: Star Zeng Date: Sun, 9 Oct 2016 07:48:02 +0000 (+0800) Subject: MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info X-Git-Tag: edk2-stable201903~3994 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=a0284a9a5820e470bae2557a7e25c426e62c8a4e MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info REF: https://bugzilla.tianocore.org/show_bug.cgi?id=570 Use PdbStringOffset to get PDB info, it will have no functional impact, and will just make the code more generic. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao --- diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c index 338eb8191f..072ae72dcd 100644 --- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c +++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -249,8 +249,8 @@ GetDriverNameString ( // // Method 1: Get the name string from image PDB // - if (DriverInfo->Header.Length > sizeof (MEMORY_PROFILE_DRIVER_INFO)) { - GetShortPdbFileName ((CHAR8 *) (DriverInfo + 1), mNameString); + if (DriverInfo->PdbStringOffset != 0) { + GetShortPdbFileName ((CHAR8 *) ((UINTN) DriverInfo + DriverInfo->PdbStringOffset), mNameString); return mNameString; }