Hi James,<br><br>clang is able to generate correct debug informations for 64-bit target at -O2. My feeling, given some other experiments I've done,  is that debug information generated for x86 32-bit might be broken for parameters as long as they are not 'homed' in the code (local copy to an automatic variable). It seems that when llvm.declare is turned into a llvm.value for parameter there is something incorrect with respect to parameters debug informations that is generated by clang/llvm. I just would like confirmation of this.<br>
<br>Thanks for your answer<br>Best Regards<br>Seb<br><br><div class="gmail_quote">2012/3/7 James Molloy <span dir="ltr"><<a href="mailto:james.molloy@arm.com">james.molloy@arm.com</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">









<div link="blue" vlink="purple" lang="EN-GB">

<div>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">Hi Seb,<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">Clang cannot generate debug information for something that it
has optimised away. You should reduce the optimisation level.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">In general debug information is only really accurate at –O0.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">Cheers,<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">James<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p>

<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) -moz-use-text-color -moz-use-text-color;padding:3pt 0cm 0cm">

<p class="MsoNormal"><b><span style="font-size:10pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>
[mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Seb<br>
<b>Sent:</b> 07 March 2012 13:17<br>
<b>To:</b> <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br>
<b>Subject:</b> [LLVMdev] Problem with x86 32-bit debug information ?<u></u><u></u></span></p>

</div><div><div class="h5">

<p class="MsoNormal"><u></u> <u></u></p>

<p class="MsoNormal" style="margin-bottom:12pt"><span>Hi all,</span><br>
<br>
<span>I'm using trunk version of LLVM/CLANG.</span><br>
<span>When I compile attached files on my 64-bit Ubuntu 10.04 LTS
system as follows:</span><br>
<br>
<span>clang -O2 -g check.c main.c -o check64</span><br>
<br>
<span>When I do gdb check64 and set a breakpoint to the check routine
and executes to the breakpoint, I've got:</span><br>
<br>
<span>Breakpoint 1, check (result=0x601110, expect=0x601020, n=53) at
check.c:7</span><br>
<span>7    {</span><br>
<br>
<span>As you can see I can inspect 'n' value.</span><br>
<br>
<span>Now if I compile for x86 32-bit as follows:</span><br>
<br>
<span>clang -m32 -O2 -g check.c main.c -o check32</span><br>
<br>
<span>When I do gdb check32 and set a breakpoint to the check routine
and executes to the breakpoint, I've got:</span><br>
<br>
Breakpoint 1, check (result=<value optimized out>, <br>
    expect=<value optimized out>, n=0) at check.c:7<br>
7    {<br>
<br>
As you can see I can NOT inspect 'n' value. Is there a way to inforce even at
-O2 clang to generate debug informations so that I can inspect 'n' value ?<br>
Or is it a BUG from clang for x86 32-bit ?<br>
Thanks for your answers.<br>
Best Regards<br>
Seb<u></u><u></u></p>

</div></div></div>

</div>

</blockquote></div><br>