public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info
@ 2017-05-23  6:27 Star Zeng
  2017-05-23  6:43 ` Yao, Jiewen
  0 siblings, 1 reply; 2+ messages in thread
From: Star Zeng @ 2017-05-23  6:27 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Jiewen Yao

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info
  2017-05-23  6:27 [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info Star Zeng
@ 2017-05-23  6:43 ` Yao, Jiewen
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2017-05-23  6:43 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-23  6:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23  6:27 [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info Star Zeng
2017-05-23  6:43 ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox