[LLVMdev] Debug info generation through llvm backend

sivakumar srinivasan sks200203 at gmail.com
Wed Feb 9 20:05:25 PST 2011


Hi Devang,

Thanks for the pointers. I will take some time to chew on this
information and looking at different pieces of sources.

Thanks, Jean-Daniel and Andrew for the search answers.

-sks



On Wed, Feb 9, 2011 at 12:21 AM, Devang Patel <dpatel at apple.com> wrote:
>
> 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?
>
> ?
>
> -
> Devang
>




More information about the llvm-dev mailing list