[PATCH] D103502: Bug 41152 - [DebugInfo] Better dumping of empty location expression

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 07:48:21 PDT 2021


SouraVX accepted this revision.
SouraVX added a comment.
This revision is now accepted and ready to land.

> It looks like the existing test is producing an empty range as a side-effect of the behaviour under test, and so it would be quite possible that the test coverage would be lost if this beahviour changed/the testing method changed for it. What do others think?

+1, I think one small `asm` test case with just related things (section .debug_loclists and the entry) would be great to have.
Sort of :

  $ cat test.s
  .Lfunc_begin0:
  .Ltmp1:
  .section .debug_loclists, "", at progbits
          .long   .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
  .Ldebug_list_header_start0:
          .short  5                               # Version
          .byte   8                               # Address size
          .byte   0                               # Segment selector size
          .long   1                               # Offset entry count
  .Lloclists_table_base0:
          .long   .Ldebug_loc0-.Lloclists_table_base0
  .Ldebug_loc0:
          .byte   4                               # DW_LLE_offset_pair
          .uleb128 .Lfunc_begin0-.Lfunc_begin0    #   starting offset
          .uleb128 .Ltmp1-.Lfunc_begin0           #   ending offset
          .byte   0                               ### empty
          .byte   0                               # DW_LLE_end_of_list
  .Ldebug_list_header_end0:

Which materializing into existing thing & post this should materialize into `<empty>`

  $  llvm-dwarfdump --debug-loclists test.o
  test.o: file format elf64-x86-64
  
  .debug_loclists contents:
  locations list header: length = 0x00000011, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
  offsets: [
  0x00000004
  ]
  0x00000010:
              DW_LLE_offset_pair     (0x0000000000000000, 0x0000000000000000):


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103502



More information about the llvm-commits mailing list