[LLVMdev] question on generating dwarf metadata

Devang Patel dpatel at apple.com
Fri Dec 3 16:28:19 PST 2010


On Dec 3, 2010, at 2:39 PM, Bagel wrote:

> I am writing a front end for a new language and am having trouble generating 
> the DWARF debugging information.  I'm outputting llvm assembly source so I'm 
> trying to generate the "!metadata" stuff.
> 
> I have found the document <http://llvm.org/docs/SourceLevelDebugging.html> a 
> helpful start, as far as it goes.  However, it doesn't quite match what I see 
> clang produce when I use the flags "clang -g -S -emit-llvm ..." in all cases. 
> And it is incomplete, for example, how does one deal with a function that 
> returns multiple values?
> 
> I seem to get different results when I feed the .ll file to llc than when I 
> feed it the clang, clang gives error messages when it doesn't like the metadata 
> structure, llc appears not to do so.
> 
> Is there another document I should look at?
> 
> Should I be looking at source code?  Where are the structures that start with 
> DW_TAG's parsed?
> 
> In general, what's resources does a front end implementer have in order to 
> understand how to generate the DWARF stuff via llvm assembly source?


We are working on a document. Here is current draft:
	http://wiki.llvm.org/Debug_Information

-
Devang



More information about the llvm-dev mailing list