From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 810E1210C1251 for ; Tue, 24 Jul 2018 06:44:46 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 06:44:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,398,1526367600"; d="scan'208";a="69487923" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga003.jf.intel.com with ESMTP; 24 Jul 2018 06:44:44 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Yunhua Feng , Liming Gao Date: Tue, 24 Jul 2018 21:44:42 +0800 Message-Id: <1532439882-5748-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Fix bug about *M value not display decimal and hexadecimal X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 13:44:46 -0000 From: Yunhua Feng report format like as below: *M Shell.inf = 0xFF (255) Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/build/BuildReport.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 176a390..178d340 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1117,11 +1117,16 @@ class PcdReport(object): if IsByteArray: FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, '{')) for Array in ArrayList: FileWrite(File, Array) else: - FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, ModuleDefault.strip())) + Value = ModuleDefault.strip() + if Value.startswith(('0x', '0X')): + Value = '{} ({:d})'.format(Value, int(Value, 0)) + else: + Value = "0x{:X} ({})".format(int(Value, 0), Value) + FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, Value)) if ModulePcdSet is None: FileWrite(File, gSectionEnd) else: if not ReportSubType and ModulePcdSet: -- 2.6.1.windows.1