<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="FR-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> Alexandre Ganea
<br>
<b>Envoyé :</b> March 10, 2021 3:02 PM<br>
<b>À :</b> 'Tobias Hieta' <tobias@plexapp.com>; Adrian McCarthy <amccarth@google.com>; 'James Henderson' <jh7370.2008@my.bristol.ac.uk><br>
<b>Objet :</b> RE: [llvm-dev] Debug information with clang-cl on Windows<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">DExTer can probably help bisecting to the specific optimization pass(es) that cause the debug infos to be omitted?
<a href="https://lists.llvm.org/pipermail/llvm-dev/2018-August/125780.html">https://lists.llvm.org/pipermail/llvm-dev/2018-August/125780.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">+James.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org">llvm-dev-bounces@lists.llvm.org</a>>
<b>De la part de</b> Tobias Hieta via llvm-dev<br>
<b>Envoyé :</b> March 10, 2021 2:26 PM<br>
<b>À :</b> Adrian McCarthy <<a href="mailto:amccarth@google.com">amccarth@google.com</a>><br>
<b>Cc :</b> llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
<b>Objet :</b> Re: [llvm-dev] Debug information with clang-cl on Windows<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hello,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks for your reply!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Is it possible to disable optimisations with clang-cl and see if that makes a difference?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I will also try to build with clang 12 instead and see if there is any improvement. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Happy to try to reproduce or fix the issue - but I am unfamiliar with this debug info on windows and how to even start looking into it, any pointers are appreciated. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Tobias. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, 10 Mar 2021 at 00:45, Adrian McCarthy <<a href="mailto:amccarth@google.com">amccarth@google.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">I believe that, even with `/Od` (that's Microsoft for "disable optimizations"), clang-cl applies some optimizations.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">People on my team have been fixing debug info quality bugs for Windows for a while. I don't have specific knowledge of these issues, but it's possible newer versions (like 12 or head) may have solved this. We're somewhat more focused
on 64-bit than 32-bit builds, so you might encounter some differences there.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you can reproduce the problem with a reduced code sample, please file a bug with all the deets. If you do some debugging yourself, please let us know what you find.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Mar 9, 2021 at 2:46 PM David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">I would guess there's no one bug here - debug info quality (specifically/especially the location of variables when compiling with optimizations enabled) is a long tail/sliding scale of issues. LLVM is, on the whole, not spectacular at this
- a matter of bugs to fix, some small/simple, others more systemic/representational.<br>
<br>
If you're interested in contributing to this work - generally the first step is to isolate the problem - first thing you can do is if you have some experience dumping/examining debug info in object files, you can dump/examine the relevant object files then
try to reduce/remove code from the relevant objects, etc, to see what the minimal example is that'll make it easier to figure out how to fix.<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Mar 9, 2021 at 12:37 AM Tobias Hieta via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal">Hello,<br>
<br>
We recently switched our windows builds from the CL compiler to<br>
clang-cl. This was a pretty big jump in terms of code generation and<br>
having a uniform compiler across all the major platforms.<br>
<br>
Our setup is that our Windows developer use MSVC as the IDE and<br>
compile with our own build of clang-cl and link with lld-link.<br>
<br>
Some of the developers noticed that some of the debug information are<br>
not as good as with CL. Or rather some variables seems to be optimized<br>
out, this is what the IDE says, see attached screenshot. I have tried<br>
to figure out if there is a rhyme and reason to what variables are<br>
gone - but I have not been able to see any pattern.<br>
<br>
Our command line is:<br>
<br>
clang-cl.exe /nologo -DUNICODE -DUSE_BREAKPAD -DWIN32<br>
-DWIN32_LEAN_AND_MEAN -DWINVER=0x0601 -D_CRT_NONSTDC_NO_DEPRECATE<br>
-D_CRT_SECURE_NO_WARNINGS -D_LEGACY_NAT_TRAVERSAL_ -D_REENTRANT<br>
-D_SCL_SECURE_NO_WARNINGS -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS<br>
-D_UNICODE -D_WIN32_WINNT=0x0601 -D_WINSOCK_DEPRECATED_NO_WARNINGS<br>
-Iincludes -m32 -fdiagnostics-absolute-paths<br>
--target=i686-windows-msvc -m32 /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0<br>
/Od /RTC1 -MDd /Zm512 /EHsc /bigobj /W3 -Werror -Wsign-compare<br>
-Wno-reorder-ctor -Wno-delete-non-virtual-dtor -Wunused-variable<br>
-Wuninitialized -std:c++14<br>
<br>
Is there any good way to debug this or is it a known limitation with<br>
clang-cl or 32 bit (we don't do 64 yet - but with clang-cl we hope to<br>
move towards that soon). Or am I missing some flags?<br>
<br>
Thanks,<br>
Tobias<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>