DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
@ 2019-05-20 10:27 Adham Masarwah
  2019-05-20 18:02 ` Menon, Ranjit
  0 siblings, 1 reply; 7+ messages in thread
From: Adham Masarwah @ 2019-05-20 10:27 UTC (permalink / raw)
  To: dev
  Cc: ranjit.menon, pallavi.kadam, Yohad Tor, Rani Sharoni,
	Tal Shnaiderman, Bruce Richardson

Hi,

In development we use WinDbg for debugging, so we need to create PDB files when compiling the DPDK, so we used ``-g`` in the CFLGAS and the PDB files are being created.
But when running the helloworld with WinDbg, we can see only function names, we can't see code neither variables, we get the following error: "Private symbols (symbols.pri) are required for locals."
We tried to append some flags like -Z7 and -gcodeview, but the compiler ignores them.

Do you have any idea what we miss here ? What is the debug mechanism is being used in Windows ?

Thanks

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

* Re: [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
  2019-05-20 10:27 [dpdk-dev] Generating Debug information in Windows using Clang (PDB files) Adham Masarwah
@ 2019-05-20 18:02 ` Menon, Ranjit
  2019-05-21  8:22   ` Bruce Richardson
  0 siblings, 1 reply; 7+ messages in thread
From: Menon, Ranjit @ 2019-05-20 18:02 UTC (permalink / raw)
  To: Adham Masarwah, dev, Omar Cardona, Harini Ramakrishnan, Jeffrey Tippet
  Cc: Kadam, Pallavi, Yohad Tor, Rani Sharoni, Tal Shnaiderman,
	Richardson, Bruce

Adham...
I don't think we debugged using clang compiled code for Hello world - mainly because it was only a "helloworld" application and we didn't quite need any debugging!:-)

I found this link: http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html
...which says to use the following:
 Here are two simple ways to test out this new functionality:

  1.  Have clang-cl invoke lld automatically
     clang-cl -fuse-ld=lld -Z7 -MTd hello.cpp

  1.  Invoke clang-cl and lld separately.
clang-cl -c -Z7 -MTd -o hello.obj hello.cpp
lld-link -debug hello.obj
Can you try it with just the -Z7 option?

I'm also adding some persons from Microsoft to this thread, hoping they can help...

+Harini +Omar +Jeffrey

ranjit m.


From: Adham Masarwah <adham@mellanox.com>
Sent: Monday, May 20, 2019 3:27 AM
To: dev@dpdk.org
Cc: Menon, Ranjit <ranjit.menon@intel.com>; Kadam, Pallavi <pallavi.kadam@intel.com>; Yohad Tor <yohadt@mellanox.com>; Rani Sharoni <ranish@mellanox.com>; Tal Shnaiderman <talshn@mellanox.com>; Richardson, Bruce <bruce.richardson@intel.com>
Subject: Generating Debug information in Windows using Clang (PDB files)

Hi,

In development we use WinDbg for debugging, so we need to create PDB files when compiling the DPDK, so we used ``-g`` in the CFLGAS and the PDB files are being created.
But when running the helloworld with WinDbg, we can see only function names, we can't see code neither variables, we get the following error: "Private symbols (symbols.pri) are required for locals."
We tried to append some flags like -Z7 and -gcodeview, but the compiler ignores them.

Do you have any idea what we miss here ? What is the debug mechanism is being used in Windows ?

Thanks

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

* Re: [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
  2019-05-20 18:02 ` Menon, Ranjit
@ 2019-05-21  8:22   ` Bruce Richardson
  2019-05-21 13:41     ` Adham Masarwah
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Richardson @ 2019-05-21  8:22 UTC (permalink / raw)
  To: Menon, Ranjit
  Cc: Adham Masarwah, dev, Omar Cardona, Harini Ramakrishnan,
	Jeffrey Tippet, Kadam, Pallavi, Yohad Tor, Rani Sharoni,
	Tal Shnaiderman

On Mon, May 20, 2019 at 07:02:22PM +0100, Menon, Ranjit wrote:
>    Adham…
> 
>    I don’t think we debugged using clang compiled code for Hello world –
>    mainly because it was only a “helloworld” application and we didn’t
>    quite need any debugging!:-)
> 
> 
>    I found this link:
>    [1]http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.
>    html
> 
>    …which says to use the following:
> 
>     Here are two simple ways to test out this new functionality:
>     1. Have clang-cl invoke lld automatically
> 
>         clang-cl -fuse-ld=lld -Z7 -MTd hello.cpp
>     2. Invoke clang-cl and lld separately.
> 
>    clang-cl -c -Z7 -MTd -o hello.obj hello.cpp
> 
>    lld-link -debug hello.obj
> 
>    Can you try it with just the -Z7 option?
> 
> 
>    I’m also adding some persons from Microsoft to this thread, hoping they
>    can help…
> 
> 
>    +Harini +Omar +Jeffrey
> 
> 
>    ranjit m.
> 
Part of the issue may be that we use clang, rather than clang-cl on
windows.

/Bruce

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

* Re: [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
  2019-05-21  8:22   ` Bruce Richardson
@ 2019-05-21 13:41     ` Adham Masarwah
  2019-05-21 13:52       ` Bruce Richardson
  0 siblings, 1 reply; 7+ messages in thread
From: Adham Masarwah @ 2019-05-21 13:41 UTC (permalink / raw)
  To: Bruce Richardson, Menon, Ranjit
  Cc: dev, Omar Cardona, Harini Ramakrishnan, Jeffrey Tippet, Kadam,
	Pallavi, Yohad Tor, Rani Sharoni, Tal Shnaiderman


>From: Bruce Richardson <bruce.richardson@intel.com> 
>Sent: Tuesday, May 21, 2019 11:22 AM
>
>On Mon, May 20, 2019 at 07:02:22PM +0100, Menon, Ranjit wrote:
>>    Adham…
>> 
>>    I don’t think we debugged using clang compiled code for Hello world –
>>    mainly because it was only a “helloworld” application and we didn’t
>>    quite need any debugging!:-)
>> 
>> 
>>    I found this link:
>>    [1]https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.llvm.org%2F2017%2F08%2Fllvm-on-windows-now-supports-pdb-debug&amp;data=02%7C01%7Cadham%40mellanox.com%7Cea97cb9cae684d72bbed08d6ddc57192%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636940237422999520&amp;sdata=2PxSjEyx%2BXatdDKMtVcXFlWQ5jnBM9nK2782jnRg1BA%3D&amp;reserved=0.
>>    html
>> 
>>    …which says to use the following:
>> 
>>     Here are two simple ways to test out this new functionality:
>>     1. Have clang-cl invoke lld automatically
>> 
>>         clang-cl -fuse-ld=lld -Z7 -MTd hello.cpp
>>     2. Invoke clang-cl and lld separately.
>> 
>>    clang-cl -c -Z7 -MTd -o hello.obj hello.cpp
>> 
>>    lld-link -debug hello.obj
>> 
>>    Can you try it with just the -Z7 option?
>> 
>> 
>>    I’m also adding some persons from Microsoft to this thread, hoping they
>>    can help…
>> 
>> 
>>    +Harini +Omar +Jeffrey
>> 
>> 
>>    ranjit m.
>> 
>Part of the issue may be that we use clang, rather than clang-cl on windows.
>
>/Bruce

I did a small test to check clang vs clang-cl, the compiled binary and the PDB file from the Clang-cl seems working fine in WinDbg.
The problem we have that the meson.build files are not compatible with clang-cl, and the meson build command is failing.
This is the first error:
config\x86\meson.build:23:1: ERROR: Problem encountered: SSE4.2 instruction set is required for DPDK.
Please set the machine type to "nehalem" or "corei7" or higher value

/Adham

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

* Re: [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
  2019-05-21 13:41     ` Adham Masarwah
@ 2019-05-21 13:52       ` Bruce Richardson
  2019-05-21 14:33         ` Adham Masarwah
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Richardson @ 2019-05-21 13:52 UTC (permalink / raw)
  To: Adham Masarwah
  Cc: Menon, Ranjit, dev, Omar Cardona, Harini Ramakrishnan,
	Jeffrey Tippet, Kadam, Pallavi, Yohad Tor, Rani Sharoni,
	Tal Shnaiderman

On Tue, May 21, 2019 at 01:41:06PM +0000, Adham Masarwah wrote:
> 
> >From: Bruce Richardson <bruce.richardson@intel.com> 
> >Sent: Tuesday, May 21, 2019 11:22 AM
> >
> >On Mon, May 20, 2019 at 07:02:22PM +0100, Menon, Ranjit wrote:
> >>    Adham…
> >> 
> >>    I don’t think we debugged using clang compiled code for Hello world –
> >>    mainly because it was only a “helloworld” application and we didn’t
> >>    quite need any debugging!:-)
> >> 
> >> 
> >>    I found this link:
> >>    [1]https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.llvm.org%2F2017%2F08%2Fllvm-on-windows-now-supports-pdb-debug&amp;data=02%7C01%7Cadham%40mellanox.com%7Cea97cb9cae684d72bbed08d6ddc57192%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636940237422999520&amp;sdata=2PxSjEyx%2BXatdDKMtVcXFlWQ5jnBM9nK2782jnRg1BA%3D&amp;reserved=0.
> >>    html
> >> 
> >>    …which says to use the following:
> >> 
> >>     Here are two simple ways to test out this new functionality:
> >>     1. Have clang-cl invoke lld automatically
> >> 
> >>         clang-cl -fuse-ld=lld -Z7 -MTd hello.cpp
> >>     2. Invoke clang-cl and lld separately.
> >> 
> >>    clang-cl -c -Z7 -MTd -o hello.obj hello.cpp
> >> 
> >>    lld-link -debug hello.obj
> >> 
> >>    Can you try it with just the -Z7 option?
> >> 
> >> 
> >>    I’m also adding some persons from Microsoft to this thread, hoping they
> >>    can help…
> >> 
> >> 
> >>    +Harini +Omar +Jeffrey
> >> 
> >> 
> >>    ranjit m.
> >> 
> >Part of the issue may be that we use clang, rather than clang-cl on windows.
> >
> >/Bruce
> 
> I did a small test to check clang vs clang-cl, the compiled binary and the PDB file from the Clang-cl seems working fine in WinDbg.
> The problem we have that the meson.build files are not compatible with clang-cl, and the meson build command is failing.
> This is the first error:
> config\x86\meson.build:23:1: ERROR: Problem encountered: SSE4.2 instruction set is required for DPDK.
> Please set the machine type to "nehalem" or "corei7" or higher value
> 
> /Adham
Yes, the clang-cl compiler (like msvc) does not offer the flags we need to
control the exact output microarchitecture. It also uses completely
different flag formats for things like warnings etc, which is why we need
to use clang instead.

/Bruce

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

* Re: [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
  2019-05-21 13:52       ` Bruce Richardson
@ 2019-05-21 14:33         ` Adham Masarwah
  2019-06-04  8:43           ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Adham Masarwah @ 2019-05-21 14:33 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Menon, Ranjit, dev, Omar Cardona, Harini Ramakrishnan,
	Jeffrey Tippet, Kadam, Pallavi, Yohad Tor, Rani Sharoni,
	Tal Shnaiderman

On Tue, May 21, 2019 at 01:41:06PM +0000, Adham Masarwah wrote:
> > 
> > >From: Bruce Richardson <bruce.richardson@intel.com>
> > >Sent: Tuesday, May 21, 2019 11:22 AM
> > >
> > >On Mon, May 20, 2019 at 07:02:22PM +0100, Menon, Ranjit wrote:
> > >>    Adham…
> > >> 
> > >>    I don’t think we debugged using clang compiled code for Hello world –
> > >>    mainly because it was only a “helloworld” application and we didn’t
> > >>    quite need any debugging!:-)
> > >> 
> > >> 
> > >>    I found this link:
> > >>    [1]https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.llvm.org%2F2017%2F08%2Fllvm-on-windows-now-supports-pdb-debug&amp;data=02%7C01%7Cadham%40mellanox.com%7Cd44c2914a2104176185008d6ddf39932%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636940435668687736&amp;sdata=%2BXND%2Be8KTPd6CBligMrSlJzsV%2BrrxnHKjQvcClwpNDk%3D&amp;reserved=0.
> > >>    html
> > >> 
> > >>    …which says to use the following:
> > >> 
> > >>     Here are two simple ways to test out this new functionality:
> > >>     1. Have clang-cl invoke lld automatically
> > >> 
> > >>         clang-cl -fuse-ld=lld -Z7 -MTd hello.cpp
> > >>     2. Invoke clang-cl and lld separately.
> > >> 
> > >>    clang-cl -c -Z7 -MTd -o hello.obj hello.cpp
> > >> 
> > >>    lld-link -debug hello.obj
> > >> 
> > >>    Can you try it with just the -Z7 option?
> > >> 
> > >> 
> > >>    I’m also adding some persons from Microsoft to this thread, hoping they
> > >>    can help…
> > >> 
> > >> 
> > >>    +Harini +Omar +Jeffrey
> > >> 
> > >> 
> > >>    ranjit m.
> > >> 
> > >Part of the issue may be that we use clang, rather than clang-cl on windows.
> > >
> > >/Bruce
> > 
> > I did a small test to check clang vs clang-cl, the compiled binary and the PDB file from the Clang-cl seems working fine in WinDbg.
> > The problem we have that the meson.build files are not compatible with clang-cl, and the meson build command is failing.
> > This is the first error:
> > config\x86\meson.build:23:1: ERROR: Problem encountered: SSE4.2 instruction set is required for DPDK.
> > Please set the machine type to "nehalem" or "corei7" or higher value
> > 
> > /Adham
> Yes, the clang-cl compiler (like msvc) does not offer the flags we need to control the exact output microarchitecture. It also uses completely different flag formats for things like warnings etc, which is why we need to use clang instead.
> 
> /Bruce
In this case we should find a solution to open the debug ability since we will need it for sure.
What can be done, who can help causing clang generates good files ? 

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

* Re: [dpdk-dev] Generating Debug information in Windows using Clang (PDB files)
  2019-05-21 14:33         ` Adham Masarwah
@ 2019-06-04  8:43           ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2019-06-04  8:43 UTC (permalink / raw)
  To: Omar Cardona, Harini Ramakrishnan, Jeffrey Tippet
  Cc: dev, Adham Masarwah, Bruce Richardson, Menon, Ranjit, Kadam,
	Pallavi, Yohad Tor, Rani Sharoni, Tal Shnaiderman

21/05/2019 16:33, Adham Masarwah:
> From: Bruce Richardson <bruce.richardson@intel.com>
> > Yes, the clang-cl compiler (like msvc) does not offer the flags we need to control the exact output microarchitecture. It also uses completely different flag formats for things like warnings etc, which is why we need to use clang instead.
> 
> In this case we should find a solution to open the debug ability since we will need it for sure.
> What can be done, who can help causing clang generates good files ? 

Please, some help from Microsoft would be very appreciated.
Thanks



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

end of thread, other threads:[~2019-06-04  8:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20 10:27 [dpdk-dev] Generating Debug information in Windows using Clang (PDB files) Adham Masarwah
2019-05-20 18:02 ` Menon, Ranjit
2019-05-21  8:22   ` Bruce Richardson
2019-05-21 13:41     ` Adham Masarwah
2019-05-21 13:52       ` Bruce Richardson
2019-05-21 14:33         ` Adham Masarwah
2019-06-04  8:43           ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).