<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=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Aha: the issue wasn't a deep problem with variadic functions (which is a relief because I don't understand those enough to fix), it's the format string using
 %8x with a variable of type uint64_t. I guess on x86_64 (which is the default testing platform for most people these days I guess) you get lucky and the variadic calling convention just happens to give the right result, but on a 32-bit platform like ARM-v7
 you end up reading from a location containing something else entirely.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I'll whip up a patch to change the format string and commit.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dave<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David Tweed
<br>
<b>Sent:</b> 07 February 2013 15:33<br>
<b>To:</b> David Tweed; 'Renato Golin'; Eli Bendersky<br>
<b>Cc:</b> LLVM Commits<br>
<b>Subject:</b> RE: [llvm] r174543 - Add a test for checking the current .debug_frame dumping capability.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Actually, I've been poking a bit more at this and ASSUMING I THE GDB OUTPUT IS RIGHT the actual values in the objects are the correct ones, something is going
 wrong in the process of printing them in llvm::format_object3<blah>. The values appear to be stored correctly in the llvm::format_object3 object but in being processed by printf something is going wrong with the third argument only. (I say "if I can trust
 gdb" because the layout when calling a variadic is context dependent, so if it's confused about the context it could be printing a different code-level interpretation of the registers.) It looks like it might be printing the stack-address of the third argument
 rather than its value, but I'm not sure about this.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I'll perhaps keep looking, but I'm not really up on the magic of implementing variadic functions on any architecture, so if anyone is more experienced feel
 free to jump in and look at this. I also wonder why, if there's a snprintf issue occurring it doesn't affect more of the regression tests?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dave<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a> [<a href="mailto:llvm-commits-bounces@cs.uiuc.edu">mailto:llvm-commits-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>David Tweed<br>
<b>Sent:</b> 07 February 2013 12:52<br>
<b>To:</b> 'Renato Golin'; Eli Bendersky<br>
<b>Cc:</b> LLVM Commits<br>
<b>Subject:</b> RE: [llvm] r174543 - Add a test for checking the current .debug_frame dumping capability.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Further to Renato's comments:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">While I don't know either about ELF or how llvm-dwarfdump reads it, I observe that if I run the failing test multiple times the hex numbers<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">00000014 00000010 beaebe7f FDE cie=00000000 pc=00000000...beaebe7f<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">in the beaebe7f positions change between runs seemingly randomly (although they all start "be") (and a few other elements of such as the Data alignment factor
 and Return address column contain garbage), suggesting that it _may_ be something is being allocated on when run on ARM but not being filled in. But that diagnosis isn't certain obviously. (Unfortunately I can't currently run valgind on my pandaboard to check
 this directly.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dave<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a> [<a href="mailto:llvm-commits-bounces@cs.uiuc.edu">mailto:llvm-commits-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Renato Golin<br>
<b>Sent:</b> 07 February 2013 10:39<br>
<b>To:</b> Eli Bendersky<br>
<b>Cc:</b> LLVM Commits<br>
<b>Subject:</b> Re: [llvm] r174543 - Add a test for checking the current .debug_frame dumping capability.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Eli,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This test is not working on ARM buildbots...<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a15/builds/16/steps/check-all/logs/LLVM%20%3A%3A%20DebugInfo__dwarfdump-debug-frame-simple.test">http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a15/builds/16/steps/check-all/logs/LLVM%20%3A%3A%20DebugInfo__dwarfdump-debug-frame-simple.test</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/4861/steps/check-all/logs/LLVM%20%3A%3A%20DebugInfo__dwarfdump-debug-frame-simple.test">http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/4861/steps/check-all/logs/LLVM%20%3A%3A%20DebugInfo__dwarfdump-debug-frame-simple.test</a><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">--renato<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 6 February 2013 20:55, Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Author: eliben<br>
Date: Wed Feb  6 14:55:06 2013<br>
New Revision: 174543<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=174543&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=174543&view=rev</a><br>
Log:<br>
Add a test for checking the current .debug_frame dumping capability.<br>
<br>
The test is a binary placed in test/DebugInfo/Inputs, with a source C<br>
file used for reference/reproducing. The source's first line is a clang<br>
build command for reproducing the binary.<br>
<br>
<br>
Added:<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o   (with props)<br>
    llvm/trunk/test/DebugInfo/dwarfdump-debug-frame-simple.test<br>
<br>
Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c?rev=174543&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c?rev=174543&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c (added)<br>
+++ llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c Wed Feb  6 14:55:06 2013<br>
@@ -0,0 +1,14 @@<br>
+// clang -c -g -o dwarfdump-test-32bit.elf.o -m32 dwarfdump-test-32bit.elf.c<br>
+<br>
+extern int glob;<br>
+<br>
+int foo(int arg) {<br>
+  int a = arg * 2;<br>
+  return a + glob;<br>
+}<br>
+<br>
+int bar(int arg) {<br>
+  int a = foo(arg) * foo(arg * 2);<br>
+  return glob - foo(a);<br>
+}<br>
+<br>
<br>
Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o?rev=174543&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o?rev=174543&view=auto</a><br>
==============================================================================<br>
Binary file - no diff available.<br>
<br>
Propchange: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o<br>
------------------------------------------------------------------------------<br>
    svn:mime-type = application/octet-stream<br>
<br>
Added: llvm/trunk/test/DebugInfo/dwarfdump-debug-frame-simple.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-debug-frame-simple.test?rev=174543&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-debug-frame-simple.test?rev=174543&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/dwarfdump-debug-frame-simple.test (added)<br>
+++ llvm/trunk/test/DebugInfo/dwarfdump-debug-frame-simple.test Wed Feb  6 14:55:06 2013<br>
@@ -0,0 +1,14 @@<br>
+; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-32bit.elf.o -debug-dump=frames | FileCheck %s -check-prefix FRAMES<br>
+<br>
+; FRAMES: .debug_frame<br>
+; FRAMES-NOT: .eh_frame<br>
+<br>
+; FRAMES: 00000000 00000010 ffffffff CIE<br>
+; FRAMES: Version: 1<br>
+<br>
+; FRAMES: 00000014 00000010 00000000 FDE cie=00000000 pc=00000000...00000022<br>
+; FRAMES: 00000028 00000014 00000000 FDE cie=00000000 pc=00000030...00000080<br>
+<br>
+; FRAMES-NOT: CIE<br>
+; FRAMES-NOT: FDE<br>
+<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<br>
<font face="Arial" color="Black" size="2">-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents
 to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br>
</font>
</body>
</html>