From 6780eef1f9ed0af24795708c3be7adafd7113691 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Mon, 15 Nov 2010 02:51:34 +0000 Subject: 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 --- BaseTools/Source/C/BootSectImage/bootsectimage.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/C/BootSectImage') 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; -- cgit v1.2.3