[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

Sourabh Singh Tomar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 29 02:20:03 PST 2019


SouraVX added a comment.

Hi @yonghong-song ,  Thanks for doing this. 
I have a doubt, regarding clang behavior, is this relevant to this.

Consider the following test case --

  extern global_var;
  int main(){}

Now when compiled with clang -g test.c, In file ELF[DWARF] file
their is no, DebugInfo for `global_var`. 
While gcc compiled binary gcc -g test.c. has DebugInfo[DWARF]

  DW_TAG_variable
               DW_AT_name      ("global_var")
               DW_AT_decl_file ("/test.c)
               DW_AT_decl_line (1)
               DW_AT_decl_column       (0x0c)
               DW_AT_type      (0x00000039 "int")
               DW_AT_external  (true)
               DW_AT_declaration       (true)

Is this relevant ? Does this patch, adds support for this in clang ? I mean `DIGlobalVariable` related stuff in clang generated Debug Metadata ? seems to, but still confirming.
Maybe I can use this, to build DWARF related DebugInfo on top of this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70696/new/

https://reviews.llvm.org/D70696





More information about the cfe-commits mailing list