pyelftools icon indicating copy to clipboard operation
pyelftools copied to clipboard

examples/dwarf_location_lists.py and examples/dwarf_range_lists.py fail with Jython

Open Arfrever opened this issue 11 years ago • 2 comments

examples/dwarf_location_lists.py and examples/dwarf_range_lists.py fail with Jython. Other examples/*.py tests pass with Jython. All examples/*.py tests pass with CPython.

$ jython2.7 test/run_examples_test.py
Example './examples/dwarf_decode_address.py'
Example './examples/dwarf_location_lists.py'
.......FAIL comparison
@@ Output #1 dumped to file: /tmp/out1_bbpziI.stdout
Example './examples/examine_dwarf_info.py'
Example './examples/elfclass_address_size.py'
Example './examples/elf_show_debug_sections.py'
Example './examples/elf_low_high_api.py'
Example './examples/dwarf_range_lists.py'
.......FAIL comparison
@@ Output #1 dumped to file: /tmp/out1_WfqAXl.stdout
Example './examples/elf_relocations.py'
Example './examples/dwarf_die_tree.py'

Conclusion: FAIL

Arfrever avatar Jun 05 '14 06:06 Arfrever

$ cat /tmp/out1_bbpziI.stdout
Processing file: ./examples/sample_exe64.elf
  Found a compile unit at offset 0, length 115
  Found a compile unit at offset 119, length 135
  Found a compile unit at offset 258, length 156
   DIE DW_TAG_subprogram. attr DW_AT_frame_base.
      LocationEntry(begin_offset=0L, end_offset=1L, loc_expr=[119, 8]) <<(DW_OP_breg7 (rsp): 8)>>
      LocationEntry(begin_offset=1L, end_offset=4L, loc_expr=[119, 16]) <<(DW_OP_breg7 (rsp): 16)>>
      LocationEntry(begin_offset=4L, end_offset=43L, loc_expr=[118, 16]) <<(DW_OP_breg6 (rbp): 16)>>
  Found a compile unit at offset 418, length 300
   DIE DW_TAG_subprogram. attr DW_AT_frame_base.
      LocationEntry(begin_offset=16L, end_offset=64L, loc_expr=[119, 8]) <<(DW_OP_breg7 (rsp): 8)>>
      LocationEntry(begin_offset=64L, end_offset=153L, loc_expr=[119, 192, 0]) <<(DW_OP_breg7 (rsp): 64)>>
   DIE DW_TAG_formal_parameter. attr DW_AT_location.
      LocationEntry(begin_offset=16L, end_offset=85L, loc_expr=[85]) <<(DW_OP_reg5 (rdi))>>
      LocationEntry(begin_offset=85L, end_offset=143L, loc_expr=[94]) <<(DW_OP_reg14 (r14))>>
   DIE DW_TAG_formal_parameter. attr DW_AT_location.
      LocationEntry(begin_offset=16L, end_offset=85L, loc_expr=[84]) <<(DW_OP_reg4 (rsi))>>
      LocationEntry(begin_offset=85L, end_offset=138L, loc_expr=[93]) <<(DW_OP_reg13 (r13))>>
   DIE DW_TAG_formal_parameter. attr DW_AT_location.
      LocationEntry(begin_offset=16L, end_offset=85L, loc_expr=[81]) <<(DW_OP_reg1 (rdx))>>
      LocationEntry(begin_offset=85L, end_offset=133L, loc_expr=[92]) <<(DW_OP_reg12 (r12))>>
   DIE DW_TAG_variable. attr DW_AT_location.
      LocationEntry(begin_offset=92L, end_offset=123L, loc_expr=[83]) <<(DW_OP_reg3 (rbx))>>
$ cat /tmp/out1_WfqAXl.stdout
Processing file: ./examples/sample_exe64.elf
  Found a compile unit at offset 0, length 115
  Found a compile unit at offset 119, length 135
  Found a compile unit at offset 258, length 156
  Found a compile unit at offset 418, length 300
   DIE DW_TAG_lexical_block. attr DW_AT_ranges.
[RangeEntry(begin_offset=26L, end_offset=40L), RangeEntry(begin_offset=85L, end_offset=118L), RangeEntry(begin_offset=73L, end_offset=77L), RangeEntry(begin_offset=64L, end_offset=67L)]

Arfrever avatar Jun 05 '14 06:06 Arfrever

Thanks for report. I'm unlikely to find time to debug this in the near future, so pull requests are welcome.

eliben avatar Jun 05 '14 12:06 eliben