LexicalScope Debug Info - Line Number

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LexicalScope Debug Info - Line Number

dessu
Hi,
I need to find out the line no info for each lexical block in the code
being compiled with llc. The docs mention metadata format for debug
info for lexical block is


!3 = metadata !{
  i32,                                  ;; Tag = 11 + LLVMDebugVersion
(DW_TAG_lexical_block)
  metadata,                         ;; Reference to context descriptor
  i32,                                  ;; Line number
  i32                                   ;; Column number
}

So the line no. info is present as its 3rd member. I am trying to
extract this line number either directly from the corresponding
DbgScope variable passed as argument to
constructScopeDIE function. OR from the ScopeDIE variable (DIE* type)
after it is populated with the debug info in DIE format.

Please help me with the functions which I can use to extract this information.

Thanks and Regards,
Ankur
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: LexicalScope Debug Info - Line Number

Devang Patel
Ankur,

On Jul 26, 2011, at 7:58 PM, ankur deshwal wrote:

> Hi,
> I need to find out the line no info for each lexical block in the code
> being compiled with llc. The docs mention metadata format for debug
> info for lexical block is
>
>
> !3 = metadata !{
>  i32,                                  ;; Tag = 11 + LLVMDebugVersion
> (DW_TAG_lexical_block)
>  metadata,                         ;; Reference to context descriptor
>  i32,                                  ;; Line number
>  i32                                   ;; Column number
> }
>
> So the line no. info is present as its 3rd member. I am trying to
> extract this line number either directly from the corresponding
> DbgScope variable passed as argument to
> constructScopeDIE function. OR from the ScopeDIE variable (DIE* type)
> after it is populated with the debug info in DIE format.
>

Metadata is used to encode lexical block at LLVM IR level. However, DbgScope is internal to DwarfWriter (which is part of code generator)  and it is lowered from metadata. DbgScope does not need line number information, it is focused on identify set of instructions for a lexical block.

> Please help me with the functions which I can use to extract this information.
>

At what point in compilation you want to extract line number information ? And what is the intended use ?
-
Devang

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev