Debug info generation through llvm backend

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?
  • also, how to search through mailing list archives?

Thanks,
-sks

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

http://blog.gmane.org/gmane.comp.compilers.llvm.devel

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