public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Huajing Li <huajing.li@intel.com>, Jaben Carsey <jaben.carsey@intel.com>
Subject: [PATCH] ShellPkg/dmpstore: Show name of known variable vendor GUID
Date: Mon, 18 Sep 2017 14:42:27 +0800	[thread overview]
Message-ID: <20170918064227.295020-1-ruiyu.ni@intel.com> (raw)

From: Huajing Li <huajing.li@intel.com>

Change "dmpstore" to show name of known variable vendor GUID.
The name is got from ShellProtocol.GetGuidName().

Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li <huajing.li@intel.com>
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c  | 17 +++++++++++++----
 .../UefiShellDebug1CommandsLib.uni                      |  1 +
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
index aeffc89b19..062ab5dc3a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
@@ -424,6 +424,7 @@ CascadeProcessVariables (
   CHAR16                    *AttrString;
   CHAR16                    *HexString;
   EFI_STATUS                SetStatus;
+  CHAR16                    *GuidName;
 
   if (ShellGetExecutionBreakFlag()) {
     return (SHELL_ABORTED);
@@ -521,10 +522,18 @@ CascadeProcessVariables (
             Status = EFI_OUT_OF_RESOURCES;
           }
         } else {
-          ShellPrintHiiEx (
-            -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,
-            AttrString, &FoundVarGuid, FoundVarName, DataSize
-            );
+          Status = gEfiShellProtocol->GetGuidName(&FoundVarGuid, &GuidName);
+          if (EFI_ERROR (Status)) {
+            ShellPrintHiiEx (
+              -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,
+              AttrString, &FoundVarGuid, FoundVarName, DataSize
+              );
+          } else {
+            ShellPrintHiiEx (
+              -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE2), gShellDebug1HiiHandle,
+              AttrString, GuidName, FoundVarName, DataSize
+              );
+          }
           DumpHex (2, 0, DataSize, DataBuffer);
         }
         SHELL_FREE_NON_NULL (AttrString);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
index f733a67f0b..b6a133a454 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
@@ -385,6 +385,7 @@
 #string STR_DMPSTORE_LOAD_GEN_FAIL     #language en-US "%H%s%N: Failed to set variable %H%s%N: %r.\r\n"
 #string STR_DMPSTORE_LOAD_BAD_FILE     #language en-US "%H%s%N: Incorrect file format.\r\n"
 #string STR_DMPSTORE_HEADER_LINE       #language en-US "Variable %H%s%N '%H%g%N:%H%s%N' DataSize = 0x%02x\r\n"
+#string STR_DMPSTORE_HEADER_LINE2      #language en-US "Variable %H%s%N '%H%s%N:%H%s%N' DataSize = 0x%02x\r\n"
 #string STR_DMPSTORE_DELETE_LINE       #language en-US "Delete variable '%H%g%N:%H%s%N': %r\r\n"
 #string STR_DMPSTORE_NO_VAR_FOUND      #language en-US "%H%s%N: No matching variables found.\r\n"
 #string STR_DMPSTORE_NO_VAR_FOUND_SFO  #language en-US "VariableInfo,\"\",\"\",\"\",\"\",\"\"\r\n"
-- 
2.12.2.windows.2



             reply	other threads:[~2017-09-18  6:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18  6:42 Ruiyu Ni [this message]
2017-09-18 15:24 ` [PATCH] ShellPkg/dmpstore: Show name of known variable vendor GUID Carsey, Jaben
2017-09-21  5:30   ` Ni, Ruiyu
2017-09-21 13:11     ` Carsey, Jaben
2017-09-22  9:43 ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170918064227.295020-1-ruiyu.ni@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox