From nobody Thu Dec 26 13:06:35 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1506059433261994.6270335114247; Thu, 21 Sep 2017 22:50:33 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7ACB82095E4F3; Thu, 21 Sep 2017 22:47:17 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 266D22095E4E4 for ; Thu, 21 Sep 2017 22:47:15 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 21 Sep 2017 22:50:22 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.7]) by fmsmga006.fm.intel.com with ESMTP; 21 Sep 2017 22:50:21 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="154738608" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 22 Sep 2017 13:50:06 +0800 Message-Id: <20170922055014.27288-7-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170922055014.27288-1-ruiyu.ni@intel.com> References: <20170922055014.27288-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 06/14] ShellPkg/dh: Modify the dump of LoadedImage protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Huajing Li MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Huajing Li Reviewed-by: Ruiyu Ni Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Huajing Li --- .../UefiHandleParsingLib/UefiHandleParsingLib.c | 24 ++++++++++++++----= ---- .../UefiHandleParsingLib/UefiHandleParsingLib.h | 3 ++- .../UefiHandleParsingLib/UefiHandleParsingLib.inf | 3 ++- .../UefiHandleParsingLib/UefiHandleParsingLib.uni | 3 ++- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b= /ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index 1f2ca92bdd..b9eb564dd0 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -232,14 +232,11 @@ LoadedImageProtocolDumpInformation( CHAR16 *RetVal; CHAR16 *Temp; CHAR16 *FileName; + CHAR8 *PdbFileName; CHAR16 *FilePath; CHAR16 *CodeType; CHAR16 *DataType; =20 - if (!Verbose) { - return (CatSPrint(NULL, L"LoadedImage")); - } - Status =3D gBS->OpenProtocol ( TheHandle, &gEfiLoadedImageProtocolGuid, @@ -253,10 +250,20 @@ LoadedImageProtocolDumpInformation( return NULL; } =20 - HandleParsingHiiInit(); - FileName =3D FindLoadedImageFileName(LoadedImage); + FilePath =3D ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE); + if (!Verbose) { + if (FileName =3D=3D NULL) { + FileName =3D FilePath; + } else { + SHELL_FREE_NON_NULL(FilePath); + } + RetVal =3D CatSPrint(NULL, FileName); + SHELL_FREE_NON_NULL(FileName); + return RetVal; + } =20 + HandleParsingHiiInit(); RetVal =3D NULL; if (FileName !=3D NULL) { Temp =3D HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUM= P_NAME), NULL); @@ -273,9 +280,7 @@ LoadedImageProtocolDumpInformation( if (Temp =3D=3D NULL) { return NULL; } - - FilePath =3D ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE); - + PdbFileName =3D PeCoffLoaderGetPdbPointer (LoadedImage->ImageBase); DataType =3D ConvertMemoryType(LoadedImage->ImageDataType); CodeType =3D ConvertMemoryType(LoadedImage->ImageCodeType); =20 @@ -287,6 +292,7 @@ LoadedImageProtocolDumpInformation( LoadedImage->SystemTable, LoadedImage->DeviceHandle, FilePath, + PdbFileName, LoadedImage->LoadOptionsSize, LoadedImage->LoadOptions, LoadedImage->ImageBase, diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b= /ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h index ada2b4aa38..cf849658aa 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h @@ -1,7 +1,7 @@ /** @file Provides interface to advanced shell functionality for parsing both hand= le and protocol database. =20 - Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.
This program and the accompanying materials @@ -153,6 +153,7 @@ #include #include #include +#include =20 #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1 1 #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2 2 diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf= b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf index 3bd4dbe423..4c1c3d3846 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf @@ -1,6 +1,6 @@ ## @file # Provides interface to advanced shell functionality for parsing both han= dle and protocol database. -# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# @@ -50,6 +50,7 @@ [LibraryClasses] UefiLib HiiLib SortLib + PeCoffGetEntryPointLib =20 [Protocols] gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CON= SUMES diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni= b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni index e07c9a1670..8541399b68 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni @@ -355,13 +355,14 @@ " SystemTable...: %%= H%x%%N\r\n" " DeviceHandle..: %%= H%x%%N\r\n" " FilePath......: %%= H%s%%N\r\n" + " PdbFileName...: %%= H%a%%N\r\n" " OptionsSize...: %%= H%x%%N\r\n" " LoadOptions...: %%= H%x%%N\r\n" " ImageBase.....: %%= H%x%%N\r\n" " ImageSize.....: %%= H%Lx%%N\r\n" " CodeType......: %%= H%s%%N\r\n" " DataType......: %%= H%s%%N\r\n" - " Unload........: %%= H%x%%N\r\n" + " Unload........: %%= H%x%%N" =20 #string STR_GOP_DUMP_MAIN #language en-US " Max Mode..........= ..: %%H0x%08x%%N\r\n" " Current Mode......= ..: %%H0x%08x%%N\r\n" --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel