diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-15 02:51:34 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-15 02:51:34 +0000 |
commit | 6780eef1f9ed0af24795708c3be7adafd7113691 (patch) | |
tree | 1a9fd2fca0bd71c4a64a8bf3f10e492f45a232d8 /BaseTools/Source/C/BootSectImage/bootsectimage.c | |
parent | 5460c4bbc5aa9d99d25c55c6b936166bea3dbea0 (diff) | |
download | edk2-platforms-6780eef1f9ed0af24795708c3be7adafd7113691.tar.xz |
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
Diffstat (limited to 'BaseTools/Source/C/BootSectImage/bootsectimage.c')
-rw-r--r-- | BaseTools/Source/C/BootSectImage/bootsectimage.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/BaseTools/Source/C/BootSectImage/bootsectimage.c b/BaseTools/Source/C/BootSectImage/bootsectimage.c index a907e214f4..0d0a3cbf77 100644 --- a/BaseTools/Source/C/BootSectImage/bootsectimage.c +++ b/BaseTools/Source/C/BootSectImage/bootsectimage.c @@ -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;
|