<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 20, 2013 at 2:21 PM, Erkki Lindpere <span dir="ltr"><<a href="mailto:villane@gmail.com" target="_blank">villane@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br>I wanted to add debug info to my language (compiler written in Scala, outputs .ll files), but I found it really hard to do based on the documentation provided at <a href="http://llvm.org/docs/SourceLevelDebugging.html" target="_blank">http://llvm.org/docs/SourceLevelDebugging.html</a> (I looked at the specific doc for LLVM 3.0 though)<br>

<br></div>With LLVM 3.0, DI version 8 (which is documented there) seemed to work, except DW_TAG_auto_variable for which I used version tag 11 and imitated what clang was doing. <br><br>Got that working for simple programs, but now I switched to LLVM 3.2 and that debug info doesn't work any more. My best bet seems to be looking at how Clang/LLVM does it internally.<br>

</div><br>PS. For anyone else looking for this, lib/VMCore/DIBuilder.cpp seems to be the best place to look what the structures should look like.<br><br></div></div></blockquote><div><br></div><div style>Yes. You should use DIBuilder if at all possible or construct something that does the same thing if you need bindings. But I'd probably just do bindings, producing the text is the least portable way.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div>My question is, any plans to updating the documentation? Documenting different versions of the debug info is probably too much, but the docs should at least be of a working version (of course it's possible that Version 8 works fine and I was just doing something wrong).</div>
</blockquote><div><br></div><div style>We've removed the versioning on debug info recently and it will continue to be an unstable format for the foreseeable future. Updating the documentation is definitely possible, and should be happening as we move around fields and change things. It's possible it hasn't happened of late and so that should probably be fixed. A good chunk of the layout still looks correct - but will be incorrect against any released version even if it was updated. It should reflect top of tree.</div>
<div style><br></div><div style>That said, looking at how clang emits debug information is guaranteed to be the current correct way to emit it so that what you emit is understood by the backend and if you've got any specific questions the mailing list should work well.</div>
<div style><br></div><div style>-eric</div><div style><br></div><div style><br></div></div></div></div>