getting debug info

Hi all,

I am wondering if someone can give me pointers to how to use the DI* classes defined in DebugInfo.h. In particular, I am confused about how to get a MDNode from the GlobalVariable's that hold the debug info so that they can be passed into the DI* classes, and the difference between MDNode and NamedMDNode in general. Thanks for your help.


Now, MDNode is used to hold debug info. Which tool are you using to
generate llvm IR with debugging information ?

I am using the trunk version of llvm-gcc to generate the debug info, and I have checked out the DebugInfoFinder class. Basically, I am interested in looking up debug info for structures, and I am wondering if there is a way for me to look up the debug info associated with a Type * directly instead of building a custom map from Type * to DICompositeType by iterating through the type iterator in DebugInfoFinder.

Devang Patel wrote:

That's the only way. The llvm::Type does not know anything about some
other entity describing the type to generate debugging information.