From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mx.groups.io with SMTP id smtpd.web12.469.1576176966511269500 for ; Thu, 12 Dec 2019 10:56:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@broadcom.com header.s=google header.b=BX7jnT3w; spf=pass (domain: broadcom.com, ip: 209.85.210.54, mailfrom: vladimir.olovyannikov@broadcom.com) Received: by mail-ot1-f54.google.com with SMTP id d17so3091453otc.0 for ; Thu, 12 Dec 2019 10:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc:content-transfer-encoding; bh=JH/aVMnO777qksuQun9cf05hvnoWUVARv5LFqNNck3k=; b=BX7jnT3wMJp9Wpg/4HHI0XyQM5/FYhkyN0subD5glqk5AAUd0vI1Gjywj9SIcsJG0M No7BnszL4BKcuy3wuqAJoNmsI/OjCra4eC5/RkTwpUsB6FMXC163KOo11qbPF9QMFcaR ML5LZ6Yuk7+o2+o0gba3EaNjS/93yeb/AvXQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc :content-transfer-encoding; bh=JH/aVMnO777qksuQun9cf05hvnoWUVARv5LFqNNck3k=; b=C2UUxHX6a1IixpBp8DdF98s6zGB3Xj6WxoWFfYJ8JYWg6qhwuhmqMOvm9YYD1LTaB4 YMUYFHfrsZOz/PTzvKgmtmNdZqZwX0yvhA4qdARzsI8CYlGS2f19rd4HKkW/r4fPkXBf mk+kKSh7VRkIVhZqXpW5FDHavZrcbE7OvS3j17miimE8RbPtiWhOSHlZ+1lj2Sx3iwv/ nFPcHkrmEab1xmDoaU5mEfBd0mqdniLfEjZEQMaqpt+dy1g/6TqVUDZxW7ezalp4ZwMb 9KrElTSXDDAqvYx22nl860AGrDCAUuYHdENmfqW6QYJnQVBNfwkRAfWjP3vGW7uf1pc8 YoZw== X-Gm-Message-State: APjAAAXtVPOBfDGHbeXrCSKHf9akDNe390E2usui4eWqihgJGzfyl3Cu N7GImx9M7FGqKVPNCBibTrtrWQ8NRBc9oVnltzU5rw== X-Google-Smtp-Source: APXvYqwQPXH/HpuIJAFdjnIjKIA1ini19UzPB6C+WOa3fgTb4P6PpNEW3hwbiLg7536rE8fqDc5hp7ScojJj6KKMNhU= X-Received: by 2002:a05:6830:611:: with SMTP id w17mr9922044oti.191.1576176965508; Thu, 12 Dec 2019 10:56:05 -0800 (PST) From: "Vladimir Olovyannikov" References: <102e9863f7b0a90cbf854d059d9bcf25@mail.gmail.com> <04a4b0a07c2c090141430d7427e1a405@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHNMhFW+D8eqrEobP/0gFQWkMCeUQIWX4WqAsgeWUMB1/AwggEqQkPIAnj4taIAyAvhw6duxqSg Date: Thu, 12 Dec 2019 10:56:02 -0800 Message-ID: Subject: Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler To: Sami Mujawar , Ard Biesheuvel Cc: devel@edk2.groups.io, nd , Matteo Carlini , Laura Moretta Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sami, I follow your reply style below. > -----Original Message----- > From: Sami Mujawar > Sent: Thursday, December 12, 2019 10:33 AM > To: Vladimir Olovyannikov ; Ard > Biesheuvel > Cc: devel@edk2.groups.io; nd ; Matteo Carlini > ; Laura Moretta > Subject: RE: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compile= r > > Hi Vladimir, > > Please find may response marked [SAMI] > > Regards, > > Sami Mujawar > > -----Original Message----- > From: Vladimir Olovyannikov > Sent: 12 December 2019 05:51 PM > To: Sami Mujawar ; Ard Biesheuvel > > Cc: devel@edk2.groups.io; nd > Subject: RE: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compile= r > > > -----Original Message----- > > From: Sami Mujawar > > Sent: Thursday, December 12, 2019 8:07 AM > > To: Ard Biesheuvel ; Vladimir Olovyannikov > > > > Cc: edk2-devel-groups-io ; nd > > Subject: RE: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm > > compiler > > > > Hi Vladimir, > > > > I have built the edk2 firmware using the following toolchains and find > > that the symbols are loaded correctly using DS5. > > - gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz > > - gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz > > The above toolchains are available at > > https://developer.arm.com/tools-and- > > software/open-source-software/developer-tools/gnu-toolchain/gnu- > > a/downloads > > > > So, it looks like the problem you mention may have something to do > > with the toolchain shipped with Yocto. > Hi Sami, > Thank you for reply. I tried with the same 8.x compilers and still have > issues > with symbols. > Building with gcc-6.3 - symbols and stacks are OK. Maybe, you have some > docs on how you load symbols, and I do it wrong? > > > [SAMI] I am using WSL (Windows subsystem for Linux) for building the > firmware and DS5 on a Windows host PC. > I am assuming you are using DS5 on a Linux host PC. I will try to recreat= e > this > on a Linux PC. > [/SAMI] [VLAD] Yes, I am using Linux based DS5 and build using cross compiler. [/VLAD] > > Maybe you can point me to different DS5 python scripts? > > [SAMI] I have used the DS5 'add-symbol-file' command to load the symbols. > I > copy the edk2 serial log output and run in the DS5 command window. > e.g. I run the following command in DS5 command window to load the > symbols: > add-symbol-file c:\workspace\Build\ArmVExpress-FVP- > AArch64\DEBUG_GCC5\AARCH64\ArmPkg\Drivers\ArmGic\ArmGicDxe\DEB > UG\ArmGicDxe.dll 0xFAF05000 [/SAMI] [VLAD] So, you don't use scripts to load symbols for all loaded modules? How do you know where it was loaded if you build RELEASE and don't want extra debug messages? [/VLAD] > > The present ones limit the path length to be 255 chars, and it provides > wrong > add-symbol-line (truncates > filenames) if the path length exceeds 255. > > [SAMI] I have requested our DS5 team for more information/help with this > issue. > Can you let me know the DS5 version that you are using, please? > [/SAMI] [VLAD] I have DS5 v5.22 and also tried with Arm Development Studio 201910912. Behavior is identical. Those are the python scripts inside edk2 (ArmPlatformPkg/Scripts/Ds5) which need to be adjusted? [/VLAD] > > > Thank you, > Vladimir > > > > Regards, > > > > Sami Mujawar > > > > -----Original Message----- > > From: Ard Biesheuvel > > Sent: 11 December 2019 02:51 PM > > To: Vladimir Olovyannikov > > Cc: Sami Mujawar ; edk2-devel-groups-io > > > > Subject: Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm > > compiler > > > > On Tue, 10 Dec 2019 at 18:25, Vladimir Olovyannikov > > wrote: > > > > > > > -----Original Message----- > > > > From: Ard Biesheuvel > > > > Sent: Tuesday, December 10, 2019 9:13 AM > > > > To: Vladimir Olovyannikov ; > > Sami > > > > Mujawar > > > > Cc: edk2-devel-groups-io > > > > Subject: Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm > > > > compiler > > > > > > > > On Sat, 7 Dec 2019 at 00:50, Vladimir Olovyannikov > > > > wrote: > > > > > > > > > > Hi Ard, > > > > > > > > > > > > > > > > > > > > We are about to switch to the latest Yocto. It is shipped with > > > > > gcc-8.3 > > > > aarch64-linux-gnu compiler. > > > > > > > > > > We use DS5 for bare metal debugging. > > > > > > > > > > When I build edk2 with gcc-7-x/gcc-8.x, DS5 complains on DWARF > > format. > > > > > I tried to explicitly set it to DWARF2, but still cannot even > > > > > get the stack or local variables (even though DS5 does not > > > > > complain), even for > > > > > edk2 > > > > NOOPT build. > > > > > > > > > > > > > > > > > > > > Using gcc-6.3 from Linaro, I don=E2=80=99t see any issue with DS5 > > > > > debugging. > > > > > > > > > > Am I missing any steps? > > > > > > > > > > Build is done with GCC5_AARCH64_PREFIX=3Daarch64-linux-gnu > > > > > > > > > > > > > > > > > > > > Another question: it seems that the DS5 scripts limit the path > > > > > size with > > > > > 255 > > > > chars. With a source built by Yocto, it can easily be more than > > > > that. > > > > > > > > > > Attempt to add symbols for such modules ends up with error > > > > > message in > > > > the DS5 command window that it could not add those symbols. > > > > > > > > > > Is there a procedure to increase the path length limit? > > > > > > > > > > > > > I have never in my life used a DS-5 to debug EDK2 running on bare > > > > metal, so unfortunately, I won't be able to help you. > > > > > > > How do you normally debug edk2 with DS5? Or, are you using a > > > different mechanism? > > > Debugging with DS5 was/is very convenient. > > > > > > > I do my prototyping mainly in QEMU, using GDB for debug. > Ard, should I do similar for a real specific v8 board?