[LLVMdev] Debug info generation through llvm backend

Jean-Daniel Dupas devlists at shadowlab.org
Tue Feb 8 11:04:10 PST 2011


Le 8 févr. 2011 à 19:51, Devang Patel a écrit :

> 
> On Feb 6, 2011, at 8:52 PM, sivakumar srinivasan wrote:
> 
>> Hi Everyone,
>> 
>> I am really new to LLVM. I am working on something where I had to pick-up a half-cooked backend and need to add debug support to it. I have searched through messages but could not find a nice starting place. Could some one please provide me with some pointers about
>> - what is already supported in llvm as far as emitting debugging information is concerned?
>> - how to emit debug information through a llvm backend (any step-by-step process)?
>> - any existing implementation?
> 
> x86, ARM etc.. backends now emit debug info in DWARF format. To understand how it works, follow how @llvm.dbg.declare and @llvm.dbg.value intrinsics are lowered, at instruction selection time, from LLVM IR into machine instructions.
> 
> Most of the work required here is target independent (note, DWARF format is also used to encode EH info, which is a separate story). Target independent AsmPrinter does bulk of the work  (see DwarfDebug.cpp and AsmPrinter.cpp). The ongoing MC work is moving some of the printing stuff into MC world, where target specific support is required to support respective object file format.
> 
> You may need to  
> - enable certain flags for your target, see TargetLoweringObjectFile.h
> - provide a dwarf register map, see Target.td and TargetRegisterInfo.h
> 
>> - also, how to search through mailing list archives?
> 
> ?

Google is your friend. Just append the following statement to your search and it should work:

site:http://lists.cs.uiuc.edu/pipermail/llvmdev/

for exemple, looking for debug symbols

debug symbols site:http://lists.cs.uiuc.edu/pipermail/llvmdev/


-- Jean-Daniel








More information about the llvm-dev mailing list