[PATCH] D69847: DWARFDebugLoc(v4): Add an incremental parsing function

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 05:24:41 PST 2019


SouraVX added a comment.

> Could you share this binary or some instructions how to produce it. I know there are some issues with dumping gcc-produced range/location lists, but I don't think this has to do with how they are terminated. The for instance, if I tried to do a section-based  dump ("inline dumps" work fine, but they don't show end-of-list entries) of the location list from https://reviews.llvm.org/D69847#1753190, then I'd get an error like "error: LLE of kind 2 not supported". However this is due to the "view" blurbs that gcc inserts and not about location lists per se. (Which kind of ties in to the discussion of how should we actually perform section dumps -- there's an opinion that just scanning through the section and printing location lists (i.e. what llvm-dwarfdump -debug-loc is doing now) is not correct/legal, and that one should always start from the debug_info section and follow references from there. Gcc apparently exploits this fact to insert some custom data into the debug_loc/range sections)

Ah, Did I communicated intentions here, this problem of multiple spurious `DW_LLE*` will arise if, I placed or fix it that way, 
`Asm->OutStreamer->EmitIntValue(0, Size)` -- not needed, I suppose after this discussion. thank you for clarifying this.

But remain with GCC compiled binaries-- 
test case--
compiled with
` gcc -O2 -gdwarf-4 -gsplit-dwarf test.c` GCC version 9.2.0

  int func(int* ptr){
          printf("%d\n",*ptr);     return *ptr + 5;
  }
  int main(){
          int a = 4;     int* ptr_a = &a;
          int b = func(ptr_a);
          return 0;
  }
  
  llvm-dwarfdump --debug-loc test.dwo
  .debug_loc.dwo contents:
  0x00000000:
              DW_LLE_end_of_list     ()
  +... DW_LLE_end_of_list
  
  0x00000004:
              DW_LLE_startx_length   (0x00000000, 0x0000000e): DW_OP_reg5 RDI
              DW_LLE_startx_length   (0x00000002, 0x0000000e): DW_OP_GNU_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value
              DW_LLE_end_of_list     ()
  +... DW_LLE_end_of_list
  ... like wise




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69847





More information about the llvm-commits mailing list