From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 64CC22205BEBE for ; Wed, 3 Jan 2018 16:54:03 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 16:59:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,504,1508828400"; d="scan'208";a="17304254" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 03 Jan 2018 16:59:06 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 3 Jan 2018 16:59:06 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 3 Jan 2018 16:59:05 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Thu, 4 Jan 2018 08:59:04 +0800 From: "Yao, Jiewen" To: Paulo Alcantara , "edk2-devel@lists.01.org" CC: Rick Bramley , "Dong, Eric" , Andrew Fish , Laszlo Ersek Thread-Topic: [edk2] [RFC v4 0/6] Stack trace support in X64 exception handling Thread-Index: AQHTgFgAYtyjS3CxH06W18aHOyF3nqNi7P3g Date: Thu, 4 Jan 2018 00:59:03 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA6F8E1@shsmsx102.ccr.corp.intel.com> References: <00e14f85d93a2e81ab008f32020f3048fe4857fb.1510662518.git.pcacjr@zytor.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmQ2MDc5Y2QtNjVjZi00ZWVlLThmOTYtOTRjMzExYTE4NjQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJUcitVckgxQklxRHNuYklNZ1NBcnNRZW9YekhnZTRPb3lwa2dpeUZvWDN3R2pCWGFCbk5VT0E4YTI4d2FUaGtkIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [RFC v4 0/6] Stack trace support in X64 exception handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jan 2018 00:54:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Paulo. I tried to apply the patch series to latest code, but fail with below messa= ge. Have you rebased to latest code? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D git.exe am --3way --ignore-space-change --keep-cr "C:\home\EdkIIGit\edk2\[e= dk2]-[RFC-v4-1-6]-UefiCpuPkg-CpuExceptionHandlerLib-X64-Add-stack-trace-sup= port.patch" Applying: UefiCpuPkg/CpuExceptionHandlerLib/X64: Add stack trace support Using index info to reconstruct a base tree... M UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c Falling back to patching base and 3-way merge... Auto-merging UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHan= dler.c CONFLICT (content): Merge conflict in UefiCpuPkg/Library/CpuExceptionHandle= rLib/X64/ArchExceptionHandler.c Patch failed at 0001 UefiCpuPkg/CpuExceptionHandlerLib/X64: Add stack trace= support The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". .git/rebase-apply/patch:13: trailing whitespace. // .git/rebase-apply/patch:14: trailing whitespace. // Unknown PDB file name .git/rebase-apply/patch:15: trailing whitespace. // .git/rebase-apply/patch:16: trailing whitespace. GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mUnknownPdbFileName =3D "????"; .git/rebase-apply/patch:17: trailing whitespace. warning: squelched 369 whitespace errors warning: 374 lines add whitespace errors. error: Failed to merge in the changes. Fail =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Pa= ulo > Alcantara > Sent: Friday, December 29, 2017 11:49 AM > To: edk2-devel@lists.01.org > Cc: Rick Bramley ; Dong, Eric > ; Andrew Fish ; Yao, Jiewen > ; Laszlo Ersek > Subject: [edk2] [RFC v4 0/6] Stack trace support in X64 exception handlin= g >=20 > Hi, >=20 > This series adds stack trace support during IA32 and X64 CPU exceptions. >=20 > Informations like back trace, stack contents and image module names > (that were part of the call stack) will be dumped out. >=20 > The current limitation is that it relies on available frame pointers > (GCC only) in order to successfully unwind the stack. >=20 > (Sorry for the very long delay - I was very busy working on something > else and then went to vacations) >=20 > Jiewen, >=20 > I have tested it with VS2015x86 and the stack trace just hanged when > printing out the first EIP (that is, no frame pointer at all). >=20 > Thanks! > Paulo >=20 > Repo: https://github.com/pcacjr/edk2.git > Branch: stacktrace_v4 >=20 > Cc: Rick Bramley > Cc: Andrew Fish > Cc: Eric Dong > Cc: Laszlo Ersek > Cc: Brian Johnson > Cc: Jeff Fan > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Paulo Alcantara > --- >=20 > v1 -> v2: > * Add IA32 arch support (GCC toolchain only) > * Replace hard-coded stack alignment value (16) with > CPU_STACK_ALIGNMENT. > * Check for proper stack and frame pointer alignments. > * Fix initialization of UnwoundStacksCount to 1. > * Move GetPdbFileName() to common code since it will be used by both > IA32 and X64 implementations. >=20 > v2 -> v3: > * Fixed wrong assumption about "RIP < ImageBase" to start searching > for another PE/COFF image. That is, RIP may point to lower and > higher addresses for any other PE/COFF images. Both IA32 & X64. > (Thanks Andrew & Jiewen) > * Fixed typo: unwond -> unwound. Both IA32 & X64. (Thanks Brian) >=20 > v3 -> v4: > * Validate all frame/stack pointer addresses before dereferencing them > as requested by Brian & Jiewen. > * Correctly print out IP addresses during the stack traces (by Jeff) >=20 > Paulo Alcantara (6): > UefiCpuPkg/CpuExceptionHandlerLib/X64: Add stack trace support > UefiCpuPkg/CpuExceptionHandlerLib: Export GetPdbFileName() > UefiCpuPkg/CpuExceptionHandlerLib/Ia32: Add stack trace support > UefiCpuPkg/CpuExceptionHandlerLib: Add helper to valid memory > addresses > UefiCpuPkg/CpuExceptionHandlerLib: Ensure valid frame/stack pointers > UefiCpuPkg/CpuExceptionHandlerLib: Correctly print IP addresses >=20 > UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c > | 484 ++++++++++++++++++-- > UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h > | 41 +- > UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c | > 445 +++++++++++++++++- > UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c | > 384 +++++++++++++++- > 4 files changed, 1296 insertions(+), 58 deletions(-) >=20 > -- > 2.14.3 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel