public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
@ 2019-12-06 23:50 Vladimir Olovyannikov
  2019-12-10 17:13 ` Ard Biesheuvel
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Olovyannikov @ 2019-12-06 23:50 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

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’t see any issue with DS5 debugging.

Am I missing any steps?

Build is done with GCC5_AARCH64_PREFIX=aarch64-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?



Thank you,
Vladimir

[-- Attachment #2: Type: text/html, Size: 2401 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-06 23:50 Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler Vladimir Olovyannikov
@ 2019-12-10 17:13 ` Ard Biesheuvel
  2019-12-10 17:25   ` Vladimir Olovyannikov
  0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2019-12-10 17:13 UTC (permalink / raw)
  To: Vladimir Olovyannikov, Sami Mujawar; +Cc: edk2-devel-groups-io

On Sat, 7 Dec 2019 at 00:50, Vladimir Olovyannikov
<vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5 debugging.
>
> Am I missing any steps?
>
> Build is done with GCC5_AARCH64_PREFIX=aarch64-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.

I have added Sami to cc, he might know. Sami?

-- 
Ard.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-10 17:13 ` Ard Biesheuvel
@ 2019-12-10 17:25   ` Vladimir Olovyannikov
  2019-12-11 14:51     ` Ard Biesheuvel
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Olovyannikov @ 2019-12-10 17:25 UTC (permalink / raw)
  To: Ard Biesheuvel, Sami Mujawar; +Cc: edk2-devel-groups-io

> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: Tuesday, December 10, 2019 9:13 AM
> To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>; Sami
> Mujawar <Sami.Mujawar@arm.com>
> Cc: edk2-devel-groups-io <devel@edk2.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
> <vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5 debugging.
> >
> > Am I missing any steps?
> >
> > Build is done with GCC5_AARCH64_PREFIX=aarch64-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.

Thank you,
Vladimir
> I have added Sami to cc, he might know. Sami?
>
> --
> Ard.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-10 17:25   ` Vladimir Olovyannikov
@ 2019-12-11 14:51     ` Ard Biesheuvel
  2019-12-12 16:07       ` Sami Mujawar
  0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2019-12-11 14:51 UTC (permalink / raw)
  To: Vladimir Olovyannikov; +Cc: Sami Mujawar, edk2-devel-groups-io

On Tue, 10 Dec 2019 at 18:25, Vladimir Olovyannikov
<vladimir.olovyannikov@broadcom.com> wrote:
>
> > -----Original Message-----
> > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Sent: Tuesday, December 10, 2019 9:13 AM
> > To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>; Sami
> > Mujawar <Sami.Mujawar@arm.com>
> > Cc: edk2-devel-groups-io <devel@edk2.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
> > <vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5 debugging.
> > >
> > > Am I missing any steps?
> > >
> > > Build is done with GCC5_AARCH64_PREFIX=aarch64-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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-11 14:51     ` Ard Biesheuvel
@ 2019-12-12 16:07       ` Sami Mujawar
  2019-12-12 17:51         ` Vladimir Olovyannikov
  0 siblings, 1 reply; 8+ messages in thread
From: Sami Mujawar @ 2019-12-12 16:07 UTC (permalink / raw)
  To: Ard Biesheuvel, Vladimir Olovyannikov; +Cc: edk2-devel-groups-io, nd

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.

Regards,

Sami Mujawar

-----Original Message-----
From: Ard Biesheuvel <ard.biesheuvel@linaro.org> 
Sent: 11 December 2019 02:51 PM
To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; edk2-devel-groups-io <devel@edk2.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 <vladimir.olovyannikov@broadcom.com> wrote:
>
> > -----Original Message-----
> > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Sent: Tuesday, December 10, 2019 9:13 AM
> > To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>; Sami 
> > Mujawar <Sami.Mujawar@arm.com>
> > Cc: edk2-devel-groups-io <devel@edk2.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 
> > <vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5 debugging.
> > >
> > > Am I missing any steps?
> > >
> > > Build is done with GCC5_AARCH64_PREFIX=aarch64-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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-12 16:07       ` Sami Mujawar
@ 2019-12-12 17:51         ` Vladimir Olovyannikov
  2019-12-12 18:32           ` Sami Mujawar
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Olovyannikov @ 2019-12-12 17:51 UTC (permalink / raw)
  To: Sami Mujawar, Ard Biesheuvel; +Cc: devel, nd

> -----Original Message-----
> From: Sami Mujawar <Sami.Mujawar@arm.com>
> Sent: Thursday, December 12, 2019 8:07 AM
> To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Vladimir Olovyannikov
> <vladimir.olovyannikov@broadcom.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>; nd <nd@arm.com>
> 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?
Maybe you can point me to different DS5 python scripts? 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.

Thank you,
Vladimir
>
> Regards,
>
> Sami Mujawar
>
> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: 11 December 2019 02:51 PM
> To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
> Cc: Sami Mujawar <Sami.Mujawar@arm.com>; edk2-devel-groups-io
> <devel@edk2.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
> <vladimir.olovyannikov@broadcom.com> wrote:
> >
> > > -----Original Message-----
> > > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > Sent: Tuesday, December 10, 2019 9:13 AM
> > > To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>;
> Sami
> > > Mujawar <Sami.Mujawar@arm.com>
> > > Cc: edk2-devel-groups-io <devel@edk2.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
> > > <vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5 debugging.
> > > >
> > > > Am I missing any steps?
> > > >
> > > > Build is done with GCC5_AARCH64_PREFIX=aarch64-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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-12 17:51         ` Vladimir Olovyannikov
@ 2019-12-12 18:32           ` Sami Mujawar
  2019-12-12 18:56             ` Vladimir Olovyannikov
  0 siblings, 1 reply; 8+ messages in thread
From: Sami Mujawar @ 2019-12-12 18:32 UTC (permalink / raw)
  To: Vladimir Olovyannikov, Ard Biesheuvel
  Cc: devel@edk2.groups.io, nd, Matteo Carlini, Laura Moretta

Hi Vladimir,

Please find may response marked [SAMI]

Regards,

Sami Mujawar

-----Original Message-----
From: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> 
Sent: 12 December 2019 05:51 PM
To: Sami Mujawar <Sami.Mujawar@arm.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: devel@edk2.groups.io; nd <nd@arm.com>
Subject: RE: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler

> -----Original Message-----
> From: Sami Mujawar <Sami.Mujawar@arm.com>
> Sent: Thursday, December 12, 2019 8:07 AM
> To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Vladimir Olovyannikov 
> <vladimir.olovyannikov@broadcom.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>; nd <nd@arm.com>
> 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 recreate this on a Linux PC.
[/SAMI]

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\DEBUG\ArmGicDxe.dll 0xFAF05000
[/SAMI]

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]


Thank you,
Vladimir
>
> Regards,
>
> Sami Mujawar
>
> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: 11 December 2019 02:51 PM
> To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
> Cc: Sami Mujawar <Sami.Mujawar@arm.com>; edk2-devel-groups-io 
> <devel@edk2.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 
> <vladimir.olovyannikov@broadcom.com> wrote:
> >
> > > -----Original Message-----
> > > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > Sent: Tuesday, December 10, 2019 9:13 AM
> > > To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>;
> Sami
> > > Mujawar <Sami.Mujawar@arm.com>
> > > Cc: edk2-devel-groups-io <devel@edk2.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 
> > > <vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5 debugging.
> > > >
> > > > Am I missing any steps?
> > > >
> > > > Build is done with GCC5_AARCH64_PREFIX=aarch64-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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
  2019-12-12 18:32           ` Sami Mujawar
@ 2019-12-12 18:56             ` Vladimir Olovyannikov
  0 siblings, 0 replies; 8+ messages in thread
From: Vladimir Olovyannikov @ 2019-12-12 18:56 UTC (permalink / raw)
  To: Sami Mujawar, Ard Biesheuvel; +Cc: devel, nd, Matteo Carlini, Laura Moretta

Sami,
I follow your reply style below.
> -----Original Message-----
> From: Sami Mujawar <Sami.Mujawar@arm.com>
> Sent: Thursday, December 12, 2019 10:33 AM
> To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>; Ard
> Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: devel@edk2.groups.io; nd <nd@arm.com>; Matteo Carlini
> <Matteo.Carlini@arm.com>; Laura Moretta <Laura.Moretta@arm.com>
> Subject: RE: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
>
> Hi Vladimir,
>
> Please find may response marked [SAMI]
>
> Regards,
>
> Sami Mujawar
>
> -----Original Message-----
> From: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
> Sent: 12 December 2019 05:51 PM
> To: Sami Mujawar <Sami.Mujawar@arm.com>; Ard Biesheuvel
> <ard.biesheuvel@linaro.org>
> Cc: devel@edk2.groups.io; nd <nd@arm.com>
> Subject: RE: Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler
>
> > -----Original Message-----
> > From: Sami Mujawar <Sami.Mujawar@arm.com>
> > Sent: Thursday, December 12, 2019 8:07 AM
> > To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Vladimir Olovyannikov
> > <vladimir.olovyannikov@broadcom.com>
> > Cc: edk2-devel-groups-io <devel@edk2.groups.io>; nd <nd@arm.com>
> > 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 recreate
> 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 <ard.biesheuvel@linaro.org>
> > Sent: 11 December 2019 02:51 PM
> > To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
> > Cc: Sami Mujawar <Sami.Mujawar@arm.com>; edk2-devel-groups-io
> > <devel@edk2.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
> > <vladimir.olovyannikov@broadcom.com> wrote:
> > >
> > > > -----Original Message-----
> > > > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > > Sent: Tuesday, December 10, 2019 9:13 AM
> > > > To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>;
> > Sami
> > > > Mujawar <Sami.Mujawar@arm.com>
> > > > Cc: edk2-devel-groups-io <devel@edk2.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
> > > > <vladimir.olovyannikov@broadcom.com> 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’t see any issue with DS5
> > > > > debugging.
> > > > >
> > > > > Am I missing any steps?
> > > > >
> > > > > Build is done with GCC5_AARCH64_PREFIX=aarch64-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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-12-12 18:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-06 23:50 Debugging aarch64 edk2 built with gcc-8.x 64-bit arm compiler Vladimir Olovyannikov
2019-12-10 17:13 ` Ard Biesheuvel
2019-12-10 17:25   ` Vladimir Olovyannikov
2019-12-11 14:51     ` Ard Biesheuvel
2019-12-12 16:07       ` Sami Mujawar
2019-12-12 17:51         ` Vladimir Olovyannikov
2019-12-12 18:32           ` Sami Mujawar
2019-12-12 18:56             ` Vladimir Olovyannikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox