From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web09.154.1572838112548991047 for ; Sun, 03 Nov 2019 19:28:32 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Nov 2019 19:28:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,265,1569308400"; d="scan'208";a="204481635" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 03 Nov 2019 19:28:31 -0800 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 3 Nov 2019 19:28:31 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.215]) with mapi id 14.03.0439.000; Mon, 4 Nov 2019 11:28:29 +0800 From: "Liming Gao" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [PATCH 1/2] BaseTools: Add map file parsing support for CLANG9 Thread-Topic: [PATCH 1/2] BaseTools: Add map file parsing support for CLANG9 Thread-Index: AQHVkH1uQNNdNvDBSkuUUgXt32XEPqd6Xtww Date: Mon, 4 Nov 2019 03:28:29 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E536BFA@SHSMSX104.ccr.corp.intel.com> References: <20191101062702.165544-1-zhiguang.liu@intel.com> In-Reply-To: <20191101062702.165544-1-zhiguang.liu@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 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Liu, Zhiguang >Sent: Friday, November 01, 2019 2:27 PM >To: devel@edk2.groups.io >Cc: Feng, Bob C ; Gao, Liming >Subject: [PATCH 1/2] BaseTools: Add map file parsing support for CLANG9 > >Cc: Bob Feng >Cc: Liming Gao > >Signed-off-by: Zhiguang Liu >--- > BaseTools/Source/Python/Common/Misc.py | 9 ++++++--= - > BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 9 >++++++--- > 2 files changed, 12 insertions(+), 6 deletions(-) > >diff --git a/BaseTools/Source/Python/Common/Misc.py >b/BaseTools/Source/Python/Common/Misc.py >index 714eb840ea..403715e6cc 100755 >--- a/BaseTools/Source/Python/Common/Misc.py >+++ b/BaseTools/Source/Python/Common/Misc.py >@@ -81,19 +81,22 @@ def GetVariableOffset(mapfilepath, efifilepath, >varnames): > > if len(lines) =3D=3D 0: return None > firstline =3D lines[0].strip() >+ if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', >firstline): >+ return _parseForXcodeAndClang9(lines, efifilepath, varnames) > if (firstline.startswith("Archive member included ") and > firstline.endswith(" file (symbol)")): > return _parseForGCC(lines, efifilepath, varnames) > if firstline.startswith("# Path:"): >- return _parseForXcode(lines, efifilepath, varnames) >+ return _parseForXcodeAndClang9(lines, efifilepath, varnames) > return _parseGeneral(lines, efifilepath, varnames) > >-def _parseForXcode(lines, efifilepath, varnames): >+def _parseForXcodeAndClang9(lines, efifilepath, varnames): > status =3D 0 > ret =3D [] > for line in lines: > line =3D line.strip() >- if status =3D=3D 0 and line =3D=3D "# Symbols:": >+ if status =3D=3D 0 and >(re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \ >+ or line =3D=3D "# Symbols:"): > status =3D 1 > continue > if status =3D=3D 1 and len(line) !=3D 0: >diff --git >a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py >b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py >index 7d5e4fc34a..d962ab0add 100644 >--- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py >+++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py >@@ -49,20 +49,23 @@ def parsePcdInfoFromMapFile(mapfilepath, >efifilepath): > > if len(lines) =3D=3D 0: return None > firstline =3D lines[0].strip() >+ if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', >firstline): >+ return _parseForXcodeAndClang9(lines, efifilepath) > if (firstline.startswith("Archive member included ") and > firstline.endswith(" file (symbol)")): > return _parseForGCC(lines, efifilepath) > if firstline.startswith("# Path:"): >- return _parseForXcode(lines, efifilepath) >+ return _parseForXcodeAndClang9(lines, efifilepath) > return _parseGeneral(lines, efifilepath) > >-def _parseForXcode(lines, efifilepath): >+def _parseForXcodeAndClang9(lines, efifilepath): > valuePattern =3D re.compile('^([\da-fA- >FxX]+)([\s\S]*)([_]*_gPcd_BinaryPatch_([\w]+))') > status =3D 0 > pcds =3D [] > for line in lines: > line =3D line.strip() >- if status =3D=3D 0 and line =3D=3D "# Symbols:": >+ if status =3D=3D 0 and >(re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \ >+ or line =3D=3D "# Symbols:"): > status =3D 1 > continue > if status =3D=3D 1 and len(line) !=3D 0: >-- >2.16.2.windows.1