From nobody Tue Apr 30 04:41:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44359+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44359+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564023769; cv=none; d=zoho.com; s=zohoarc; b=cSC82Np21QAXRcRkPVMo9PzFGKuzA90HyYM5AA0Ex8eny1OHhwmDhcl9w2Nf1yi4U+giLriTFCkgSWhQLYZpjpEtjMhpYraxnc38e9ezKFbBP5Wi6bUfNP+ilg4FHttOKKvuOQj6wfN+3Fu0Svvl3wH8PZBIEJVsPZXhuWpibiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564023769; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=7E3E5mHaPI1iUHda8Kg+AdeLigfKj8a3RuipCvRb/Oo=; b=MCoxdmAifuBL/0dcqgl4EZkmyQG3yWPBa8oeOF/HVNtEY5VT4hyzh7i56f+KS+3O9Xxd1J9L+Zm/7vMUtk9uWDOXdNJlUxKB/hxQl2JNtjg4LP6qGpPXaNvqV5dqpo4EFp7w30xVOuBjPBip5Z74TuJ0z2QtOXXmY3P84Isa3tg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44359+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1564023769925251.4055210151953; Wed, 24 Jul 2019 20:02:49 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Wed, 24 Jul 2019 20:02:49 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2019 20:02:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,305,1559545200"; d="scan'208";a="175077986" X-Received: from zhijufax-mobl.ccr.corp.intel.com ([10.239.196.141]) by orsmga006.jf.intel.com with ESMTP; 24 Jul 2019 20:02:47 -0700 From: "Fan, ZhijuX" To: devel@edk2.groups.io Cc: Max Knutsen , Bob Feng , Liming Gao , "Zhiju . Fan" Subject: [edk2-devel] [PATCH V2] BaseTools:Add extra debugging message Date: Thu, 25 Jul 2019 11:02:17 +0800 Message-Id: <20190725030217.16596-1-zhijux.fan@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhijux.fan@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564023769; bh=mv5Mo/3r3aYVd88mnh9wmf8jTDBxlrHm6CrUaiZyUXk=; h=Cc:Date:From:Reply-To:Subject:To; b=tPCGSAIfqyD1Cm7Yg42sRKboNLFEZp1wmNA6mtFjpqPIv1nA3gnEBVLY10zLesA2moR H6AQr0TFkJGIHLrPSYTaKXAHLvZxTcSdQFCV5yNOlAOAFj9hiRgCF/uJ4Mdv37rVxmQuJ aYML+PqQIyNy4BlGmQhXBBNn+gsYDB8d+8g= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Knutsen BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2014 Add extra debugging to improve error identification. Error while processing file if the file is read incorrectly This patch is going to fix that issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan Reviewed-by: Liming Gao Reviewed-by: Philippe Mathieu-Daude --- BaseTools/Source/Python/AutoGen/StrGather.py | 16 ++++++++++------ BaseTools/Source/Python/Trim/Trim.py | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py b/BaseTools/Sourc= e/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, IsCompatib= leMode): 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 ident= ifier: " + 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 string i= dentifier: " + StrName) + UniObjectClass.SetStringReferenced(StrName) + except: + EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "SearchS= tring: 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/Python= /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, Tri= mLong): try: with open(Source, "r") as File: Lines =3D File.readlines() - except: + except IOError: EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DSource) + expect: + EdkLogger.error("Trim", AUTOGEN_ERROR, "TrimPreprocessedFile: Erro= r while processing file", File=3DSource) =20 PreprocessedFile =3D "" InjectedFile =3D "" --=20 2.14.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44359): https://edk2.groups.io/g/devel/message/44359 Mute This Topic: https://groups.io/mt/32594584/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-