From 64c7a74917f653145a398f91749518960d09b918 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Fri, 27 Apr 2012 01:47:35 +0000 Subject: Enable print error info when execute the application. Signed-off-by: Eric Dong Reviewed-by: Jaben Carsey git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13224 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/Shell.c | 18 +++++++++++++++++- ShellPkg/Application/Shell/Shell.uni | Bin 4618 -> 4612 bytes 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'ShellPkg') diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index aa4dfd37ab..35ffae8e9c 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -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); diff --git a/ShellPkg/Application/Shell/Shell.uni b/ShellPkg/Application/Shell/Shell.uni index c4eb546af7..71484b441e 100644 Binary files a/ShellPkg/Application/Shell/Shell.uni and b/ShellPkg/Application/Shell/Shell.uni differ -- cgit v1.2.3