Library to read ELF file DWARF debug information

后端 未结 4 401
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 13:55

Any recommendations for a good cross-platform library for reading ELF file debug information in DWARF format? I\'d like to read the DWARF debug info in a Python program.

4条回答
  •  自闭症患者
    2020-12-05 14:43

    You might be interested in the DWARF library from pydevtools:

    >>> from devtools.dwarf import DWARF
    >>> dwarf = DWARF('test/test')
    >>> dwarf.get_loc_by_addr(0x8048475)
    ('/home/emilmont/Workspace/dbg/test/main.c', 36, 0)
    >>> print dwarf
    .debug_info
    COMPILE_UNIT
    <0><11> compile_unit producer: GNU C 4.4.3 language: C89 name: a/test.c comp_dir: /home/emilmont/Workspace/dbg/test low_pc: 0x080483e4 high_pc: 0x08048410 stmt_list: 0 [...]

提交回复
热议问题