[LLVMdev] LexicalScope Debug Info - Line Number

ankur deshwal a.s.deshwal at gmail.com
Tue Jul 26 19:58:15 PDT 2011


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



More information about the llvm-dev mailing list