Sync EDKII BaseTools to BaseTools project r2093.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11057 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2010-11-15 02:51:34 +00:00
parent 5460c4bbc5
commit 6780eef1f9
49 changed files with 1138 additions and 531 deletions

View File

@@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "fat.h"
#include "mbr.h"
#include "EfiUtilityMsgs.h"
#include "ParseInf.h"
#define DEBUG_WARN 0x1
#define DEBUG_ERROR 0x2
@@ -845,7 +846,9 @@ main (
BOOLEAN ProcessMbr; // -m
BOOLEAN DoParse; // -p SrcImage or -g SrcImage DstImage
BOOLEAN Verbose; // -v
UINT64 LogLevel;
EFI_STATUS EfiStatus;
SrcImage = DstImage = NULL;
ForcePatch = FALSE;
ProcessMbr = FALSE;
@@ -886,6 +889,23 @@ main (
ProcessMbr = TRUE;
} else if (strcmp (*argv, "-v") == 0 || strcmp (*argv, "--verbose") == 0) {
Verbose = TRUE;
} else if ((stricmp (*argv, "-d") == 0) || (stricmp (*argv, "--debug") == 0)) {
argc--; argv++;
if (argc < 1) {
Usage ();
return -1;
}
EfiStatus = AsciiStringToUint64 (*argv, FALSE, &LogLevel);
if (EFI_ERROR (EfiStatus)) {
Error (NULL, 0, 1003, "Invalid option value", "%s = %s", "--debug", *argv);
return 1;
}
if (LogLevel > 9) {
Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);
return 1;
}
SetPrintLevel (LogLevel);
DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", *argv);
} else {
Usage ();
return -1;