From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.54753.1606703262524733610 for ; Sun, 29 Nov 2020 18:27:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=A+1JG33a; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: bob.c.feng@intel.com) IronPort-SDR: uBf+Y3GEpGVgOpQUw/IOci/zct1upBacFPHP5YdfvslDfWarRhZD867S1RU/JLT2BLHisr7AGo GkPvDC4jLZuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9820"; a="159624162" X-IronPort-AV: E=Sophos;i="5.78,379,1599548400"; d="scan'208";a="159624162" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2020 18:27:41 -0800 IronPort-SDR: rtxshgwK93i6pqKMe5dNhBQV0tbtkUADHjzS0mB7ZPKwZuaKjV/kzOttcbOpy3u9/ehGkAshFC ueb8maiE/uqg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,379,1599548400"; d="scan'208";a="538421856" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga005.fm.intel.com with ESMTP; 29 Nov 2020 18:27:40 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 29 Nov 2020 18:27:40 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 29 Nov 2020 18:27:39 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 29 Nov 2020 18:27:39 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 29 Nov 2020 18:27:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M4UrijK2TUBq5EejrCnMrSIKTtfZSOMd3dOV8cpVFX7hPD3UBsmTsaeBqHP6v+h75+YnswbMbvwF0L9XcOKFL7nszAhZX53F5JBK3otbHy4FKPXkIPzecdOdNCYkUynEJCegHdbNg86AyGKUtTDvLR1Ej+F5EpUh5duJ1nRIA+DgK6Js05eQBF5WEZvfzvT5ZReYrLPPv/Q1iPtAreF+qt8isNSx4MoFZTnTZ0j7Y3pkxTUIc04afpns4t1hhEmgXUhai8n3Vio8B4rAcjodJEEI9FDPyQYI2HAy82438ugOJstpYSR74qPBaS0zT1dxG/38ov51ulShKAIeG9oaVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M0mBudfu93iT+cIfAPzy5+2asDJR9+OCZ5o0jkgN1Ms=; b=GDhP/S9q5u29sGB5XDjFGBzeU2z0tqkjdtIBMNAB13EJ74uOaxmrCPZc1YAxijafgCO4ziSMVV+WkxJiPO4zkmxAVxrEoZptsQ3/Jya1MpOW5tu3ZEb0mnHj8WzVjvBam3t492fFBqlKkp1AKiC16ZijHasI4coXKS8FYPFu+NnVL4bhO53dMP4NzH/6B1SXBRwLKHdeb1qAkf2uIbi6XtwZK8WGaS7VkUnaW6MimQgevnP0rtZPYpbgCoyIEUpC770YhKRe4rOT4/ShEZHZIlxEIRxXrNcJ9Sr5yh3m0sIIj3yQ66aq2mkTH+WjiaA+ifZYNuRYcdfm/qwGX2mnMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M0mBudfu93iT+cIfAPzy5+2asDJR9+OCZ5o0jkgN1Ms=; b=A+1JG33a2IiraU1lWTlDOESXRozBBz2vxnLBuAn9cnDeHIj7CuVV6UZMBrueeUiMU5u/7HAdJ/tiDG6UlRr80ZY22dNgTMiSEjxnHBbgoGdCNNa/oam4BWC7YItJtAnhzVQyQbO51lh1YQrINVUEMUU9/g5hGTYxcfUEJGjr5e4= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3593.namprd11.prod.outlook.com (2603:10b6:5:138::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.25; Mon, 30 Nov 2020 02:27:32 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb%3]) with mapi id 15.20.3611.025; Mon, 30 Nov 2020 02:27:32 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "Feng, Bob C" , "Chen, Christine" CC: Liming Gao Subject: Re: [edk2-devel] [Patch v2 1/1] BaseTools: Collect full Header files for struct finding. Thread-Topic: [edk2-devel] [Patch v2 1/1] BaseTools: Collect full Header files for struct finding. Thread-Index: AQHWwj2I1HvXGjh0wUiQyNWmwynaoqnb21wAgAQgzVA= Date: Mon, 30 Nov 2020 02:27:31 +0000 Message-ID: References: <20201124084023.1579-1-yuwei.chen@intel.com> <164B59B945536A2A.29556@groups.io> In-Reply-To: <164B59B945536A2A.29556@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3416e54c-fc26-48f5-2cae-08d894d77db0 x-ms-traffictypediagnostic: DM6PR11MB3593: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:644; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jU2HX0X2zm2zjuQURHLpuC2ht2E7c2Bkuo8ukreXtdAtrwXTqnycC9dcmPRM897PYir/Io922AC62+vVEIhKbd/ckHXl2J8fofIWsP/PakAG1cYIDMJk7WixZn9sy+WtMhHyFzj+oiBqwMVTRZ2MJWfz6JaLjX/KN5oKUrtqJRgvKGLBag/mGWNVr2ShK/VCX0gfYPPhlgAYd1lwMMWGxrw4tMGSxo6jyhy7y0HOiTd0PMstScJqBsVCRCv2ZbyHXUS66LMwjkfzDK3zKyBnV5cHMrBv4Ia595k28ukLVwul79lA6e+q6sWJHk6nSGA/eDm+HKh7BlCEQGq+XHCY69ycuNYP+Fxtiij+leUlxNPlJZnwgCaTwM8tNEpmNdWK7oVUc63ycx6O7n0MSAsn6g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(366004)(39860400002)(396003)(376002)(136003)(2906002)(5660300002)(316002)(83380400001)(8676002)(52536014)(9686003)(55016002)(8936002)(64756008)(86362001)(66446008)(66556008)(66476007)(6636002)(76116006)(66946007)(4326008)(7696005)(110136005)(71200400001)(33656002)(966005)(478600001)(6506007)(53546011)(26005)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?9N1AVnxyFeuo5TDCW3BBMouEnfGq98fV/3CQ08MBzoh6gujLtB8Ze8kCyAoj?= =?us-ascii?Q?xH3zSOdqRPOHbt3nBoHnJ7xVF8hfy1d730sphdknYEsZebna0okUcQHAfFRP?= =?us-ascii?Q?qnREwjPvP/iWIZgKlg6u0KCJrVxBCYkorrBMKFkzSVEWp2VOKQN88xgDFDrW?= =?us-ascii?Q?/UdxeLxxiAOitWJPW3gLlRnN2B8HWNAPP5XGdOXP5g9nJaORuVKg6x2QdnWl?= =?us-ascii?Q?TmNv3GBiXU7hNAUZmpSFI1heWFA/botTjyCyiTw6FZQ0UCJFAhHEpxuykB7c?= =?us-ascii?Q?Em+/oL1fMm6a37QEtM+Te2KKV9HOr4Wg7e349Q/qVmes+6KB4+Ic8/7AD1ll?= =?us-ascii?Q?qSbtWM1cGCs+NPRLV6VPuS/VUAKnVwU3O7luuBmYkwWg0bye0qWDSME/ewg1?= =?us-ascii?Q?U8LAC48/FY9bul5rRUesScUcYDtoQdPb+OGb280SxFGu594TEQZrWlKbekCd?= =?us-ascii?Q?t8IDpkGYN81zxde6IVPqA2M1nC0H+rpC+hUlXutH+LMEWuCGZs3cFeg7vvYD?= =?us-ascii?Q?6AQ5kcm90Pzat7TzNHWlEJT8OuJgQmUXwDXOUMRTx7DOU7rhBu8lnPxtbHGh?= =?us-ascii?Q?Kessk/81J+6gJcH7uzx7nkmkI06gPmIp2IDlSx0dnYwuX9y7vyjcCYjYVML/?= =?us-ascii?Q?mTmld7XQnXLoyi9orSlbO/Ce5FFB2CxaaWIVzZoeQQeQEcYrLWaHKWeouR0O?= =?us-ascii?Q?7i/K/x6N1LNWL4oke5Osb6qpdzxVDW2lXIfcGgr+85LyQMjMXGhBKxL+SxqZ?= =?us-ascii?Q?VPj1nLu6uczMJ1p5yOR0t/rL+d6buzv8pLIxGPuqaRqcZmZjd0EqlcuKPwgQ?= =?us-ascii?Q?0oHYeHQWZGJqYAH5MJmuATmbrbV5CCJZ2fNLLc0F8FKdDMYeneSzqYY2vaew?= =?us-ascii?Q?2Gs5GjR+ZUTfFxHWtmvI++wKQYPFduCsnhfJoqT2bIAPfdfAUgbig8Pe/KNs?= =?us-ascii?Q?Vr+dlmcA37YLbkWhYFxhMmN6aio1vHlTMoHzTTI9S9k=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3416e54c-fc26-48f5-2cae-08d894d77db0 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2020 02:27:31.9053 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: osb+wRt4o33Rl2Bmj3F/Om0MCWU0DCu5+QwoGKFQfNYkmdQFNlRc6JXRQDkC6jGzvZumnGclZJEHhG8v8N81YA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3593 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Create a PR for this patch https://github.com/tianocore/edk2/pull/1152=20 -----Original Message----- From: devel@edk2.groups.io On Behalf Of Bob Feng Sent: Friday, November 27, 2020 7:26 PM To: Chen, Christine ; devel@edk2.groups.io Cc: Liming Gao Subject: Re: [edk2-devel] [Patch v2 1/1] BaseTools: Collect full Header fi= les for struct finding. Reviewed-by: Bob Feng -----Original Message----- From: Chen, Christine =20 Sent: Tuesday, November 24, 2020 4:40 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao Subject: [Patch v2 1/1] BaseTools: Collect full Header files for struct fi= nding. Currently, only parts of the Header files can be collected which caused so= me struct definition can not be found. To solve this issue, Header files fu= ll collection has been added in this file to support the struct finding. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Scripts/ConvertFceToStructurePcd.py | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scr= ipts/ConvertFceToStructurePcd.py index 89e6a727a201..aeda3ff26dfe 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -370,7 +370,7 @@ class PATH(object): def __init__(self,path): self.path=3Dpath self.rootdir=3Dself.get_root_dir() - self.usefuldir=3D[] + self.usefuldir=3Dset() self.lstinf =3D {} for path in self.rootdir: for o_root, o_dir, o_file in os.walk(os.path.join(path, "OUTPUT"), = topdown=3DTrue, followlinks=3DFalse): @@ -381,7 +381,7 @@ class PATH(object): for LST in l_file: if os.path.splitext(LST)[1] =3D=3D '.lst': self.lstinf[os.path.join(l_root, LST)] =3D os.path.join= (o_root, INF) - self.usefuldir.append(path) + self.usefuldir.add(path) =20 def get_root_dir(self): rootdir=3D[] @@ -410,7 +410,7 @@ class PATH(object): =20 def header(self,struct): header=3D{} - head_re =3D re.compile('typedef.*} %s;[\n]+(.*?)(?:typedef|formset)'%= struct,re.M|re.S) + head_re =3D re.compile('typedef.*}=20 + %s;[\n]+(.*)(?:typedef|formset)'%struct,re.M|re.S) head_re2 =3D re.compile(r'#line[\s\d]+"(\S+h)"') for i in list(self.lstinf.keys()): with open(i,'r') as lst: @@ -421,9 +421,21 @@ class PATH(object): if head: format =3D head[0].replace('\\\\','/').replace('\\','/') name =3Dformat.split('/')[-1] - head =3D self.makefile(name).replace('\\','/') - header[struct] =3D head + head =3D self.headerfileset.get(name) + if head: + head =3D head.replace('\\','/') + header[struct] =3D head return header + @property + def headerfileset(self): + headerset =3D dict() + for root,dirs,files in os.walk(self.path): + for file in files: + if os.path.basename(file) =3D=3D 'deps.txt': + with open(os.path.join(root,file),"r") as fr: + for line in fr.readlines(): + headerset[os.path.basename(line).strip()] =3D line.strip() + return headerset =20 def makefile(self,filename): re_format =3D re.compile(r'DEBUG_DIR.*(?:\S+Pkg)\\(.*\\%s)'%filename) @@ -433,6 +445,7 @@ class PATH(object): dir =3D re_format.findall(read) if dir: return dir[0] + return None =20 class mainprocess(object): =20 @@ -479,7 +492,7 @@ class mainprocess(object): WARNING.append("Warning: No for struct %s"%st= ruct) title2 =3D '%s%s|{0}|%s|0xFCD00000{\n \n %s\n= \n%s\n}\n' % (PCD_NAME, c_name, struct, '', self.LST.package()[s= elf.lst_dict[lstfile]]) header_list.append(title2) - else: + elif struct not in lst._ignore: struct_dict =3D{} print("ERROR: Struct %s can't found in lst file" %struct) ERRORMSG.append("ERROR: Struct %s can't found in lst file" %s= truct) -- 2.27.0.windows.1