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.120; helo=mga04.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 8ABCF210BFF68 for ; Wed, 25 Jul 2018 17:42:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2018 17:42:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,403,1526367600"; d="scan'208";a="60724397" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 25 Jul 2018 17:41:29 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Jul 2018 17:41:27 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Jul 2018 17:41:27 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.100]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Thu, 26 Jul 2018 08:41:25 +0800 From: "Zhu, Yonghong" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [Patch] BaseTools: Fix bug about *M value not display decimal and hexadecimal Thread-Index: AQHUI7EJQbuHJ5OAFEiq+ypPZfyC4KSgq10w Date: Thu, 26 Jul 2018 00:41:25 +0000 Message-ID: References: <1532479617-6196-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1532479617-6196-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Thu, 26 Jul 2018 00:42:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yong= hong Zhu Sent: Wednesday, July 25, 2018 8:47 AM To: edk2-devel@lists.01.org Cc: Gao, Liming Subject: [edk2] [Patch] BaseTools: Fix bug about *M value not display decim= al and hexadecimal From: Yunhua Feng V2: Add the check for Pcd DatumType report format like as below: *M Shell.inf =3D 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 176a390..dd5d1c0 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1117,11 +1117,17 @@ class PcdReport(object): if IsByteArray: FileWrite(File, ' *M %-*s =3D %s' % (s= elf.MaxLen + 15, ModulePath, '{')) for Array in ArrayList: FileWrite(File, Array) else: - FileWrite(File, ' *M %-*s =3D %s' % (s= elf.MaxLen + 15, ModulePath, ModuleDefault.strip())) + Value =3D ModuleDefault.strip() + if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_= TYPES: + if Value.startswith(('0x', '0X')): + Value =3D '{} ({:d})'.format(Value= , int(Value, 0)) + else: + Value =3D "0x{:X} ({})".format(int= (Value, 0), Value) + FileWrite(File, ' *M %-*s =3D %s' % (s= elf.MaxLen + 15, ModulePath, Value)) =20 if ModulePcdSet is None: FileWrite(File, gSectionEnd) else: if not ReportSubType and ModulePcdSet: --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel