[edk2] [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info

Star Zeng posted 1 patch 6 years, 11 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[edk2] [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info
Posted by Star Zeng 6 years, 11 months ago
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 <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
index 338eb8191fa2..072ae72dcd76 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.<BR>
+  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
   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;
   }
 
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info
Posted by Yao, Jiewen 6 years, 11 months ago
Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Tuesday, May 23, 2017 2:27 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] 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 <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 6
> +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
> b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
> index 338eb8191fa2..072ae72dcd76 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.<BR>
> +  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
>    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;
>    }
> 
> --
> 2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel