<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>Hi all,</div><div><br></div><div>I'm having an issue with debug information and llc. A test program:</div>
<div><br></div><div><div>#include <iostream></div><div><br></div><div>using namespace std;</div><div><br></div><div>void foo() {</div><div> cout << "My return address is " << __builtin_return_address(0) <<</div>
<div> endl << flush;</div><div>}</div><div><br></div><div>int main(int argc, char *argv[]) {</div><div> foo();</div><div> return 0;</div><div>}</div><div><br></div><div><br></div><div>When I compile my test program to LLVM bytecode, and then use llc to take the bytecode to assembly, llc appears to strip the debugging information along the way:</div>
<div><br></div><div><div><div><div>> llvm-g++ -g -c -emit-llvm test.cpp </div><div>> llc test.o</div><div>> g++ test.o.s</div><div>> ./a.out </div><div>My return address is 0x400b92</div><div>> addr2line 0x400b92</div>
<div>??:0</div><div><br></div><div>My goal is to run a transformation pass on the bytecode to put in a few instrumentation hooks for a dynamic analysis I'm writing. Debug information, even if it's a little off, would be extremely useful to have in the final binary. This build chain worked with a 2.6svn version of llc (that is, the final binary would have debug information which corresponded reasonably well to the source. Also it seemed to work when this question was sent <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-April/021697.html" target="_blank" style="color: rgb(6, 88, 181); ">http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-April/021697.html</a>), but I recently upgraded to a 2.7svn version with the results above. Is this change intended? Is there a way tell llc to keep debug information in?</div>
<div><br></div><div>Thanks!</div><div>Nick</div></div></div></div></div></span>