Enable print error info when execute the application.

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
This commit is contained in:
ydong10 2012-04-27 01:47:35 +00:00
parent ea4fe84fe5
commit 64c7a74917
2 changed files with 17 additions and 1 deletions

View File

@ -1310,6 +1310,7 @@ RunCommand(
)
{
EFI_STATUS Status;
EFI_STATUS StatusCode;
CHAR16 *CommandName;
SHELL_STATUS ShellStatus;
UINTN Argc;
@ -1557,11 +1558,26 @@ RunCommand(
DevPath,
PostVariableCmdLine,
NULL,
NULL
&StatusCode
);
//
// Updatet last error status.
//
UnicodeSPrint(LeString, sizeof(LeString)*sizeof(LeString[0]), L"0x%08x", StatusCode);
DEBUG_CODE(InternalEfiShellSetEnv(L"DebugLasterror", LeString, TRUE););
InternalEfiShellSetEnv(L"Lasterror", LeString, TRUE);
}
}
}
//
// Print some error info.
//
if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
}
CommandName = StrnCatGrow(&CommandName, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);
RestoreArgcArgv(ShellInfoObject.NewShellParametersProtocol, &Argv, &Argc);

Binary file not shown.