[LLVMdev] Debug Information

John Criswell criswell at cs.uiuc.edu
Mon Oct 13 07:40:16 PDT 2008


Török Edwin wrote:
> [snip]
>   
>
> I wrote such a class a while ago, given an Instruction*, or a Value* it
> returns a struct containing
> file:line, original variable name, original type; and in some simple
> cases it is able to pretty-print array references as well:
>   
This sounds like exactly what I need.  I'd be very interested in having 
this code.  If you post it to llvmdev, I can take a look at it and, if 
it fits my needs, update it to TOT for you.

At this point, I can either use your code or roll my own.  It sounds 
like updating yours would be faster and more generally useful to the 
LLVM community.

-- John T.

> For example consider this snippet:
>
> call void @llvm.dbg.declare({ }* %i2, { }* bitcast
> (%llvm.dbg.variable.type* @llvm.dbg.variable13 to { }*))
> call void @llvm.dbg.stoppoint(i32 11, i32 0, { }* bitcast
> (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
> %0 = load %struct.test** %x_addr, align 8        ; <%struct.test*> [#uses=1]
> %1 = getelementptr %struct.test* %0, i32 0, i32 0        ; <[10 x i8]*>
> [#uses=1]
> %2 = getelementptr [10 x i8]* %1, i32 0, i64 10        ; <i8*> [#uses=1]
>
> %2 is pretty-printed as: variable x.buffer[10] (in
> gep-struct-field-overflow.c:8)
>
> I could update this class to LLVM TOT, and post it here for discussion.
>
> Best regards,
> --Edwin
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>   






More information about the llvm-dev mailing list