Hi, I'm currently porting some code from LLVM 2.6 to 2.8 and need to be able to extract the debug info produced by LLVM-GCC and stored in the compiled .bc file. However I admit I'm slightly confused about how exactly to do that, the documentation doesn't seem to be very clear about this, it mainly describes how to *generate* debug info. Specifically I'm wondering about the following points: 1) It seems that the various DIDescriptors contain the information I'd need, but they can only be constructed from a MDNode How do I retrieve the MDNode at the first place? Does MDNode::get() actually retrieve all the debug metadata from Module, or does it merely initialise a fresh MDNode? 2) DebugLoc has a getAsMDNode() method, but apparently it's only available for Instructions? 3) How can I retrieve a DIType instance? I can't find a way to obtain a MDNode for a Type... ? Many thanks if somebody can shed some light on this. Best regards, Jacob -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 896 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110105/cb4200be/attachment.sig>
On Jan 4, 2011, at 7:32 PM, Jacob Zimmermann wrote:> Hi, > > I'm currently porting some code from LLVM 2.6 to 2.8 and need to be able > to extract the debug info produced by LLVM-GCC and stored in the > compiled .bc file. However I admit I'm slightly confused about how > exactly to do that, the documentation doesn't seem to be very clear > about this, it mainly describes how to *generate* debug info. > Specifically I'm wondering about the following points: > > 1) It seems that the various DIDescriptors contain the information I'd > need, but they can only be constructed from a MDNode How do I retrieve > the MDNode at the first place? Does MDNode::get() actually retrieve all > the debug metadata from Module, or does it merely initialise a fresh MDNode? > > 2) DebugLoc has a getAsMDNode() method, but apparently it's only > available for Instructions? > > 3) How can I retrieve a DIType instance? I can't find a way to obtain a > MDNode for a Type... ? > > Many thanks if somebody can shed some light on this.See DebugInfoFinder interface in Analysis/DebugInfo.h - Devang
On Thu, 2011-01-06 at 11:13 -0800, Devang Patel wrote:> On Jan 4, 2011, at 7:32 PM, Jacob Zimmermann wrote: > > > Hi, > > > > I'm currently porting some code from LLVM 2.6 to 2.8 and need to be able > > to extract the debug info produced by LLVM-GCC and stored in the > > compiled .bc file. However I admit I'm slightly confused about how > > exactly to do that, the documentation doesn't seem to be very clear > > about this, it mainly describes how to *generate* debug info. > > Specifically I'm wondering about the following points: > > > > 1) It seems that the various DIDescriptors contain the information I'd > > need, but they can only be constructed from a MDNode How do I retrieve > > the MDNode at the first place? Does MDNode::get() actually retrieve all > > the debug metadata from Module, or does it merely initialise a fresh MDNode? > > > > 2) DebugLoc has a getAsMDNode() method, but apparently it's only > > available for Instructions? > > > > 3) How can I retrieve a DIType instance? I can't find a way to obtain a > > MDNode for a Type... ? > > > > Many thanks if somebody can shed some light on this. > > See DebugInfoFinder interface in Analysis/DebugInfo.hThanks Devang, however this doesn't seem to let me access local variables, do you know how I can get at them? Thanks Jacob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110107/f1bf5329/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110107/f1bf5329/attachment.sig>