From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: liming.gao@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Thu, 01 Aug 2019 05:57:40 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 05:57:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,334,1559545200"; d="scan'208";a="348075635" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 01 Aug 2019 05:57:39 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 1 Aug 2019 05:57:39 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 1 Aug 2019 05:57:38 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.65]) with mapi id 14.03.0439.000; Thu, 1 Aug 2019 20:57:37 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" , "Fan, ZhijuX" CC: Max Knutsen Subject: Re: [edk2-devel] [PATCH V2] BaseTools:Add extra debugging message Thread-Topic: [edk2-devel] [PATCH V2] BaseTools:Add extra debugging message Thread-Index: AQHVQpV0voSBS+8oKE2vvA2pji/BHqblu3aAgACQi9A= Date: Thu, 1 Aug 2019 12:57:36 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4C776D@SHSMSX104.ccr.corp.intel.com> References: <20190725030217.16596-1-zhijux.fan@intel.com> <08650203BA1BD64D8AD9B6D5D74A85D160B513D3@SHSMSX105.ccr.corp.intel.com> In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D160B513D3@SHSMSX105.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDlhM2Y1NmQtZDVlYi00YmMwLTllMTEtOTQ5MTg5MDBlZTg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMmJvdm1YNjA1bDFDYzdZc0d3SmV6aUdETUcwbUNxbU1QT09uem9wUTNvQUQwMGhMZkRWUGpkc0V1YTJySHo3SyJ9 dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action 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 Good catch. I have pushed this patch. Can you send one new patch to fix it? > -----Original Message----- > From: Feng, Bob C > Sent: Thursday, August 1, 2019 8:20 PM > To: devel@edk2.groups.io; Fan, ZhijuX > Cc: Max Knutsen ; Gao, Liming > Subject: RE: [edk2-devel] [PATCH V2] BaseTools:Add extra debugging messa= ge >=20 > Hi Zhiju, >=20 > There is a typo in this patch. See it inline. >=20 > Thanks, > Bob >=20 > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Fa= n, ZhijuX > Sent: Thursday, July 25, 2019 11:02 AM > To: devel@edk2.groups.io > Cc: Max Knutsen ; Feng, Bob C ; Gao, Liming ; Fan, ZhijuX > > Subject: [edk2-devel] [PATCH V2] BaseTools:Add extra debugging message >=20 > From: Max Knutsen >=20 > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2014 >=20 > Add extra debugging to improve error identification. > Error while processing file if the file is read incorrectly >=20 > This patch is going to fix that issue. >=20 > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Zhiju.Fan > --- > BaseTools/Source/Python/AutoGen/StrGather.py | 16 ++++++++++------ > BaseTools/Source/Python/Trim/Trim.py | 4 +++- > 2 files changed, 13 insertions(+), 7 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py b/BaseTools/So= urce/Python/AutoGen/StrGather.py > index 2e4671a433..eed30388be 100644 > --- a/BaseTools/Source/Python/AutoGen/StrGather.py > +++ b/BaseTools/Source/Python/AutoGen/StrGather.py > @@ -526,12 +526,16 @@ def SearchString(UniObjectClass, FileList, IsCompa= tibleMode): > return UniObjectClass >=20 > for File in FileList: > - if os.path.isfile(File): > - Lines =3D open(File, 'r') > - for Line in Lines: > - for StrName in STRING_TOKEN.findall(Line): > - EdkLogger.debug(EdkLogger.DEBUG_5, "Found string id= entifier: " + StrName) > - UniObjectClass.SetStringReferenced(StrName) > + try: > + if os.path.isfile(File): > + Lines =3D open(File, 'r') > + for Line in Lines: > + for StrName in STRING_TOKEN.findall(Line): > + EdkLogger.debug(EdkLogger.DEBUG_5, "Found strin= g identifier: " + StrName) > + UniObjectClass.SetStringReferenced(StrName) > + except: > + EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "Sear= chString: Error while processing file", File=3DFile, > RaiseError=3DFalse) > + raise >=20 > UniObjectClass.ReToken() >=20 > diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Pyt= hon/Trim/Trim.py > index 43119bd7ff..8767b67f7e 100644 > --- a/BaseTools/Source/Python/Trim/Trim.py > +++ b/BaseTools/Source/Python/Trim/Trim.py > @@ -73,8 +73,10 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, = TrimLong): > try: > with open(Source, "r") as File: > Lines =3D File.readlines() > - except: > + except IOError: > EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DSource) > + expect: >=20 > Typo here. expect should except >=20 > + EdkLogger.error("Trim", AUTOGEN_ERROR, "TrimPreprocessedFile: E= rror while processing file", File=3DSource) >=20 > PreprocessedFile =3D "" > InjectedFile =3D "" > -- > 2.14.1.windows.1 >=20 >=20 >=20