From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in4.apple.com (mail-out4.apple.com [17.151.62.26]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 189AA1A1DF9 for ; Fri, 9 Sep 2016 17:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1473466997; x=2337380597; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zq5S7a3LSbzZqbWZJg1FF0WBuqCrN+284JZiTXUsu1E=; b=ltIE1vYIJ4yxhaRzvlkB9dI7vIRyZNQrRgvqs+yhIcNo391mF0/2AIXrcGT49ptw rs39agjnVRCJGugk5EO9n0UhGFgz5U6kNEUaTMi6QioUO/9dPyHCrzuiX8ZmmQTA 0mY5GegCQAw7orWELVvmn7hf1Nc6yidWFXw5+Qm9CMIWxOoVAm7feyneRV6DMAg6 g5KnOGyA7DPX3tgYuqQEF5NbvCQaODyNzzRyYakLKbQNWdumxmyWdpYY02hLEPGR Y3P94hDMdmiZBemwnw4MjB1K/uxsWcIsznnNLBJKmsKQY9QQIM56ciSximmnoSpa JoPL80fMzJvNTqpEfPO9Kw==; Received: from relay2.apple.com (relay2.apple.com [17.128.113.67]) by mail-in4.apple.com (Apple Secure Mail Relay) with SMTP id 48.F3.07433.57253D75; Fri, 9 Sep 2016 17:23:17 -0700 (PDT) X-AuditID: 11973e12-f79b16d000001d09-0b-57d352758655 Received: from nwk-mmpp-sz12.apple.com (nwk-mmpp-sz12.apple.com [17.128.115.204]) by relay2.apple.com (Apple SCV relay) with SMTP id 6D.F8.09148.57253D75; Fri, 9 Sep 2016 17:23:17 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.45.195] by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPSA id <0OD900LR2IES6T70@nwk-mmpp-sz12.apple.com>; Fri, 09 Sep 2016 17:23:17 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: <1473444037-15016-1-git-send-email-ard.biesheuvel@linaro.org> Date: Fri, 09 Sep 2016 17:23:16 -0700 Cc: edk2-devel@lists.01.org, leif.lindholm@linaro.org Message-id: <4F48B3E6-DE76-4142-88D1-F7B99E59DEF0@apple.com> References: <1473444037-15016-1-git-send-email-ard.biesheuvel@linaro.org> To: Ard Biesheuvel X-Mailer: Apple Mail (2.3112) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBLMWRmVeSWpSXmKPExsUi2FDorFsadDncYN8lLYv/H3YzWuw5dJTZ 4tPuPSwOzB53ru1h8+ie/Y8lgCmKyyYlNSezLLVI3y6BK2PayjusBYeNKro6JRsY76p3MXJw SAiYSKztCuli5AQyxSQu3FvP1sXIxSEksJdR4nPPZmaIhInE84VPWCAShxglmh5/AEvwCghK /Jh8jwVkELOAvMTB87IgYWYBLYnvj1qh6t8xSux7OZkdJCEsIC7x7swmZgg7QeLuqiYwm01A WWLF/A9gNZwCXhLTmi+B2SwCqhLLPn5mhRhqKrH56Fw2iL02Ehc+fWYBsYUEPCXWvXjCBHKD iICeREuXGcTNshL7Nixgg7B3sEmsfx0ygVFkFpKrZyFcPQvJ1QsYmVcxCuUmZuboZuaZ6CUW FOSk6iXn525iBAX9dDuhHYynVlkdYhTgYFTi4d2w+1K4EGtiWXFl7iFGaQ4WJXHedSsvhgsJ pCeWpGanphakFsUXleakFh9iZOLglGpg9N4z5fYsZ6lrX0tfafutazojuWzyak0Ls2nHWW4U PLBfPvnY0rCMSNvufyym/jvvcEfueXlI7eS01wnzneynxZcbLWZ79YRh9ms9V8fdEaydje4r NvCWKenx/Ft361+QvH5pziVZ+3medkYLlwarL490bLLcbs0evDx0zxvPxd9ntLRpMzw8qcRS nJFoqMVcVJwIAJe4khxbAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeLIzCtJLcpLzFFi42IRbCg+o1sadDncYME3ZYv/H3YzWuw5dJTZ 4tPuPSwOzB53ru1h8+ie/Y8lgCmKyyYlNSezLLVI3y6BK2PayjusBYeNKro6JRsY76p3MXJy SAiYSDxf+IQFwhaTuHBvPVsXIxeHkMAhRommxx+YQRK8AoISPybfAyri4GAWkJc4eF4WJMws oCXx/VErC0T9O0aJfS8ns4MkhAXEJd6d2cQMYSdI3F3VBGazCShLrJj/AayGU8BLYlrzJTCb RUBVYtnHz6wQQ00lNh+dywax10biwqfPYMcJCXhKrHvxhAnkBhEBPYmWLjOIm2Ul9m1YwDaB UXAWkktnIVw6C8mlCxiZVzEKFKXmJFYa6SUWFOSk6iXn525iBAdqofMOxmPLrA4xCnAwKvHw Ruy8FC7EmlhWXJkLDAoOZiUR3mrfy+FCvCmJlVWpRfnxRaU5qcWHGJOBzp/ILCWanA+MoryS eEMTEwMTY2MzY2NzE3PShJXEebceORouJJCeWJKanZpakFoEs4WJg1OqgTH00Er30NcJh9f8 8GbKW1AeoiTMP/v4kwvnrq5f7BH97H2AmmWM2O1y0RdBl38FVNvaNMyrOCZwckrc+5pXpvvm uAmHheofOso7z/zaabaZ+1mqD3OJ3sp8/m6GvcUWfT5DmYPLt4cfKT704+1cptsJc9asC1Ph V/y1I9BMeVd+IkeF9WHXfy5KLMUZiYZazEXFiQAv10z5mAIAAA== Subject: Re: [PATCH] ArmPkg/DefaultExceptionHandlerLib: improve formatting of backtrace X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2016 00:23:18 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On Sep 9, 2016, at 11:00 AM, Ard Biesheuvel wrote: > > Implement the backtrace formattting suggested by Andrew, i.e., > > IRQ Exception at 0x000000005BE182B0 > PC 0x00005BE182B0 (0x00005BE14000+0x000042B0) [ 0] ArmCpuDxe.dll > PC 0x00005BE15770 (0x00005BE14000+0x00001770) [ 0] ArmCpuDxe.dll > PC 0x00005EF08CC8 (0x00005EEEB000+0x0001DCC8) [ 1] DxeCore.dll > PC 0x00005EF09008 (0x00005EEEB000+0x0001E008) [ 1] DxeCore.dll > PC 0x00005EEF6ACC (0x00005EEEB000+0x0000BACC) [ 1] DxeCore.dll > PC 0x00005EF0963C (0x00005EEEB000+0x0001E63C) [ 1] DxeCore.dll > PC 0x00005EF09A38 (0x00005EEEB000+0x0001EA38) [ 1] DxeCore.dll > PC 0x00005EF01560 (0x00005EEEB000+0x00016560) [ 1] DxeCore.dll > PC 0x00005EF02FB4 (0x00005EEEB000+0x00017FB4) [ 1] DxeCore.dll > PC 0x00005EF03098 (0x00005EEEB000+0x00018098) [ 1] DxeCore.dll > PC 0x00005EF0460C (0x00005EEEB000+0x0001960C) [ 1] DxeCore.dll > PC 0x00005EF005C4 (0x00005EEEB000+0x000155C4) [ 1] DxeCore.dll > PC 0x00005EF00360 (0x00005EEEB000+0x00015360) [ 1] DxeCore.dll > PC 0x00005EF003C8 (0x00005EEEB000+0x000153C8) [ 1] DxeCore.dll > PC 0x00005EF128D0 (0x00005EEEB000+0x000278D0) [ 1] DxeCore.dll > PC 0x00005EF12930 (0x00005EEEB000+0x00027930) [ 1] DxeCore.dll > PC 0x00005EEEF594 (0x00005EEEB000+0x00004594) [ 1] DxeCore.dll > PC 0x00005EF0CF18 (0x00005EEEB000+0x00021F18) [ 1] DxeCore.dll > PC 0x00005EF1A310 (0x00005EEEB000+0x0002F310) [ 1] DxeCore.dll > PC 0x00005EEF1808 (0x00005EEEB000+0x00006808) [ 1] DxeCore.dll > PC 0x00005EEF1E48 (0x00005EEEB000+0x00006E48) [ 1] DxeCore.dll > PC 0x00005EF0A838 (0x00005EEEB000+0x0001F838) [ 1] DxeCore.dll > PC 0x00005EEED70C (0x00005EEEB000+0x0000270C) [ 1] DxeCore.dll > PC 0x00005EEEC93C (0x00005EEEB000+0x0000193C) [ 1] DxeCore.dll > PC 0x00005EEEC024 (0x00005EEEB000+0x00001024) [ 1] DxeCore.dll > > [ 0] /home/ard/build/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/ArmPkg/Drivers/CpuDxe/CpuDxe/DEBUG/ArmCpuDxe.dll > [ 1] /home/ard/build/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll > Ard, I was just trying to start a conversation, but I can't complain about a patch. Given I seem to be having a good day with "The Force"(tm)... To process the clipboard Python tkinter makes it easy it does. So you can cut the backtrace from the terminal and run the script to symbolicate, or use a file as input. Thanks, Andrew Fish > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > .../AArch64/DefaultExceptionHandler.c | 56 ++++++++++++++-------- > 1 file changed, 37 insertions(+), 19 deletions(-) > > diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c > index 1251bb8bd6fa..2f9c2ede37c1 100644 > --- a/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c > +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c > @@ -169,31 +169,49 @@ DefaultExceptionHandler ( > SerialPortWrite ((UINT8 *) Buffer, CharCount); > > DEBUG_CODE_BEGIN (); > - CHAR8 *Pdb; > + CHAR8 *Pdb, *PrevPdb; > UINTN ImageBase; > UINTN PeCoffSizeOfHeader; > UINT64 *Fp; > + UINT64 RootFp[2]; > + UINTN Idx; > > - Pdb = GetImageName (SystemContext.SystemContextAArch64->ELR, &ImageBase, &PeCoffSizeOfHeader); > + PrevPdb = Pdb = GetImageName (SystemContext.SystemContextAArch64->ELR, &ImageBase, &PeCoffSizeOfHeader); > if (Pdb != NULL) { > - DEBUG ((EFI_D_ERROR, "%a loaded at 0x%016lx \n", BaseName (Pdb), ImageBase)); > - > - Pdb = GetImageName (SystemContext.SystemContextAArch64->LR, &ImageBase, > - &PeCoffSizeOfHeader); > - if (Pdb != NULL) { > - DEBUG ((EFI_D_ERROR, "called from %a (0x%016lx) loaded at 0x%016lx \n", > - BaseName (Pdb), SystemContext.SystemContextAArch64->LR, ImageBase)); > - } > - for (Fp = (UINT64 *)SystemContext.SystemContextAArch64->FP; > - *Fp != 0; > - Fp = (UINT64 *)Fp[0]) { > - if (Fp[1] == SystemContext.SystemContextAArch64->LR) { > - continue; > + DEBUG ((EFI_D_ERROR, "PC 0x%012lx (0x%012lx+0x%08x) [ 0] %a\n", > + SystemContext.SystemContextAArch64->ELR, ImageBase, > + SystemContext.SystemContextAArch64->ELR - ImageBase, BaseName (Pdb))); > + > + if ((UINT64 *)SystemContext.SystemContextAArch64->FP != 0) { > + Idx = 0; > + > + RootFp[0] = ((UINT64 *)SystemContext.SystemContextAArch64->FP)[0]; > + RootFp[1] = ((UINT64 *)SystemContext.SystemContextAArch64->FP)[1]; > + if (RootFp[1] != SystemContext.SystemContextAArch64->LR) { > + RootFp[0] = SystemContext.SystemContextAArch64->FP; > + RootFp[1] = SystemContext.SystemContextAArch64->LR; > + } > + for (Fp = RootFp; Fp[0] != 0; Fp = (UINT64 *)Fp[0]) { > + Pdb = GetImageName (Fp[1], &ImageBase, &PeCoffSizeOfHeader); > + if (Pdb != NULL) { > + if (Pdb != PrevPdb) { > + Idx++; > + PrevPdb = Pdb; > + } > + DEBUG ((EFI_D_ERROR, "PC 0x%012lx (0x%012lx+0x%08x) [% 2d] %a\n", > + Fp[1], ImageBase, Fp[1] - ImageBase, Idx, BaseName (Pdb))); > + } > } > - Pdb = GetImageName (Fp[1], &ImageBase, &PeCoffSizeOfHeader); > - if (Pdb != NULL) { > - DEBUG ((EFI_D_ERROR, "called from %a (0x%016lx) loaded at 0x%016lx \n", > - BaseName (Pdb), Fp[1], ImageBase)); > + PrevPdb = Pdb = GetImageName (SystemContext.SystemContextAArch64->ELR, &ImageBase, &PeCoffSizeOfHeader); > + DEBUG ((EFI_D_ERROR, "\n[ 0] %a\n", Pdb)); > + > + Idx = 0; > + for (Fp = RootFp; Fp[0] != 0; Fp = (UINT64 *)Fp[0]) { > + Pdb = GetImageName (Fp[1], &ImageBase, &PeCoffSizeOfHeader); > + if (Pdb != NULL && Pdb != PrevPdb) { > + DEBUG ((EFI_D_ERROR, "[% 2d] %a\n", ++Idx, Pdb)); > + PrevPdb = Pdb; > + } > } > } > } > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel