]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enable print error info when execute the application.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 27 Apr 2012 01:47:35 +0000 (01:47 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 27 Apr 2012 01:47:35 +0000 (01:47 +0000)
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13224 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/Shell.c
ShellPkg/Application/Shell/Shell.uni

index aa4dfd37ab6503c4c12bbaeb6e3dcd8d2917a80e..35ffae8e9c04239d88238c5055d49d8302796f55 100644 (file)
@@ -1310,6 +1310,7 @@ RunCommand(
   )\r
 {\r
   EFI_STATUS                Status;\r
+  EFI_STATUS                StatusCode;\r
   CHAR16                    *CommandName;\r
   SHELL_STATUS              ShellStatus;\r
   UINTN                     Argc;\r
@@ -1557,11 +1558,26 @@ RunCommand(
               DevPath,\r
               PostVariableCmdLine,\r
               NULL,\r
-              NULL\r
+              &StatusCode\r
              );\r
+\r
+            //\r
+            // Updatet last error status.\r
+            //\r
+            UnicodeSPrint(LeString, sizeof(LeString)*sizeof(LeString[0]), L"0x%08x", StatusCode);\r
+            DEBUG_CODE(InternalEfiShellSetEnv(L"DebugLasterror", LeString, TRUE););\r
+            InternalEfiShellSetEnv(L"Lasterror", LeString, TRUE);\r
           }\r
         }\r
       }\r
+\r
+      //\r
+      // Print some error info.\r
+      //\r
+      if (EFI_ERROR(Status)) {\r
+        ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));\r
+      }\r
+\r
       CommandName = StrnCatGrow(&CommandName, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);\r
 \r
       RestoreArgcArgv(ShellInfoObject.NewShellParametersProtocol, &Argv, &Argc);\r
index c4eb546af740ed49404465d74d22598e91becd80..71484b441e49f5e2c7fbe5e23b9d5b20336f543b 100644 (file)
Binary files a/ShellPkg/Application/Shell/Shell.uni and b/ShellPkg/Application/Shell/Shell.uni differ