[LLVMdev] Extracting Metadata of Variables

65 views
Skip to first unread message

Samaneh

unread,
Jun 20, 2010, 10:34:49 PM6/20/10
to llv...@cs.uiuc.edu

Hi,

Im new to llvm and I'm using llvm-2.6 and I know how to extract the metadata
in the stoppoints but what I'm interested in is the meta data regarding a
local variable. I know that the @llvm.dgb.declare such as:

call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type*
@llvm.dbg.variable9 to { }*))

links to meta data for @llvm.dbg.variable9 which is:

@llvm.dbg.variable9 = internal constant %llvm.dbg.variable.type { i32
459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to {
}*), i8* getelementptr inbounds ([2 x i8]* @.str8, i32 0, i32 0), { }*
bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
13, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) },
section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]

now what I'm interested is the line number "i32 13" shown in the metadata of
@llvm.dbg.variable9. I was wondering if there is a way to do so.?

Thank you

Samaneh

--
View this message in context: http://old.nabble.com/Extracting-Metadata-of-Variables-tp28944619p28944619.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Devang Patel

unread,
Jun 21, 2010, 2:35:14 PM6/21/10
to Samaneh, llv...@cs.uiuc.edu
On Sun, Jun 20, 2010 at 7:34 PM, Samaneh <snav...@uwaterloo.ca> wrote:
>
> Hi,
>
> Im new to llvm and I'm using llvm-2.6 and I know how to extract the metadata
> in the stoppoints but what I'm interested in is the meta data regarding a
> local variable. I know that the @llvm.dgb.declare such as:
>
> call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type*
> @llvm.dbg.variable9 to { }*))
>
> links to meta data for  @llvm.dbg.variable9 which is:
>
> @llvm.dbg.variable9 = internal constant %llvm.dbg.variable.type { i32
> 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to {
> }*), i8* getelementptr inbounds ([2 x i8]* @.str8, i32 0, i32 0), { }*
> bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32
> 13, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) },
> section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
>
> now what I'm interested is the line number "i32 13" shown in the metadata of
> @llvm.dbg.variable9. I was wondering if there is a way to do so.?
>

Use DIVariable from DebugInfo.h
-
Devang

Reply all
Reply to author
Forward
0 new messages