[LLVMdev] Debug information for llvm-clang

Devang Patel dpatel at apple.com
Tue Aug 9 14:08:32 PDT 2011


On Aug 9, 2011, at 1:28 PM, Irina Lipov wrote:

> Hello,
>  
> I want to retrieve maximal debug information which is generated after clang execution
> I checked the functionality for clang : DIBuilder,CGDebugInfo,DwarfDebug classes in the clang.
> They generate wide spectrum of data (For example I saw for Class type - base classes /inheritance/friends etc.) 
>  
> i want to see all the data for debugging after clang is executed..To check this I made following example
> class friendClass
> {
> public:
>  int x;
> };
> class classBase
> {
> public:
>  int get1(){return 1;}
>  int get2(){return 2;}
> };
> class classDer:public classBase
> {
> public:
>  int get1(){return 1;}
>  friend class frienClass;
> };
>  
> int f()
> {
>  classDer x;
>   return x.get1();
> }
>  
> After C:\Windows\system32>clang C:\clangParam\clangExample.cpp -S -emit-llvm -o -
>  

You need to add -g on the command line to enable debugging information.
-
Devang

> I get following output
> ; ModuleID = 'C:\clangParam\clangExample.cpp'
> target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
> target triple = "i686-pc-win32"
> %class.classDer = type { i8 }
> define i32 @_Z1fv() {
> entry:
>   %x = alloca %class.classDer, align 1
>   %call = call i32 @_ZN8classDer4get1Ev(%class.classDer* %x)
>   ret i32 %call
> }
> define linkonce_odr i32 @_ZN8classDer4get1Ev(%class.classDer* %this) nounwind align 2 {
> entry:
>   %this.addr = alloca %class.classDer*, align 4
>   store %class.classDer* %this, %class.classDer** %this.addr, align 4
>   %this1 = load %class.classDer** %this.addr
>   ret i32 1
> }
>  
> As can you see no remarks in the output about base and friend types
> Also I tried to get TemplateTypeParameter/TemplateValueParameter  in such a way for some template class but the results were "similar"
> What can you propose to solve this problems and get full/maximum debug information after clang.
> Thanks in advance.
>  
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110809/da29ca07/attachment.html>


More information about the llvm-dev mailing list