summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorHuajing Li <huajing.li@intel.com>2017-09-21 15:04:37 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-09-25 08:32:17 +0800
commit4f67a6148c6153824aa1612bed189ed812acd1eb (patch)
tree84e81f98a65ccebc7ff64d8ff1e30413b5e8ee70 /ShellPkg
parentf6e0c4b401e52c5cc14452e1130d3bbaea5f9dbf (diff)
downloadedk2-4f67a6148c6153824aa1612bed189ed812acd1eb.tar.gz
edk2-4f67a6148c6153824aa1612bed189ed812acd1eb.tar.bz2
edk2-4f67a6148c6153824aa1612bed189ed812acd1eb.zip
ShellPkg/dh: Modify the dump of LoadedImage protocol
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Huajing Li <huajing.li@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c24
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h3
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf3
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni3
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;
- if (!Verbose) {
- return (CatSPrint(NULL, L"LoadedImage"));
- }
-
Status = gBS->OpenProtocol (
TheHandle,
&gEfiLoadedImageProtocolGuid,
@@ -253,10 +250,20 @@ LoadedImageProtocolDumpInformation(
return NULL;
}
- HandleParsingHiiInit();
-
FileName = FindLoadedImageFileName(LoadedImage);
+ FilePath = ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE);
+ if (!Verbose) {
+ if (FileName == NULL) {
+ FileName = FilePath;
+ } else {
+ SHELL_FREE_NON_NULL(FilePath);
+ }
+ RetVal = CatSPrint(NULL, FileName);
+ SHELL_FREE_NON_NULL(FileName);
+ return RetVal;
+ }
+ HandleParsingHiiInit();
RetVal = NULL;
if (FileName != NULL) {
Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_NAME), NULL);
@@ -273,9 +280,7 @@ LoadedImageProtocolDumpInformation(
if (Temp == NULL) {
return NULL;
}
-
- FilePath = ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE);
-
+ PdbFileName = PeCoffLoaderGetPdbPointer (LoadedImage->ImageBase);
DataType = ConvertMemoryType(LoadedImage->ImageDataType);
CodeType = ConvertMemoryType(LoadedImage->ImageCodeType);
@@ -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 handle and protocol database.
- Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
@@ -153,6 +153,7 @@
#include <Library/ShellLib.h>
#include <Library/SortLib.h>
#include <Library/ShellCommandLib.h>
+#include <Library/PeCoffGetEntryPointLib.h>
#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 handle and protocol database.
-# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>
+# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>
# (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
#
@@ -50,6 +50,7 @@
UefiLib
HiiLib
SortLib
+ PeCoffGetEntryPointLib
[Protocols]
gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES
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"
#string STR_GOP_DUMP_MAIN #language en-US " Max Mode............: %%H0x%08x%%N\r\n"
" Current Mode........: %%H0x%08x%%N\r\n"