File: test_dwarf_v5.py

package info (click to toggle)
python-pyelftools 0.32-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 68,964 kB
  • sloc: python: 15,903; ansic: 298; asm: 86; makefile: 24; cpp: 18; sh: 4
file content (21 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import unittest

from elftools.elf.elffile import ELFFile


class TestDWARFv5(unittest.TestCase):
    def test_dwarfv5_parses(self):
        dwarfv5_basic = os.path.join('test', 'testfiles_for_unittests', 'dwarfv5_basic.elf')
        with open(dwarfv5_basic, 'rb') as f:
            elf = ELFFile(f)
            # DWARFv5 debugging information is detected.
            self.assertTrue(elf.has_dwarf_info())

            # Fetching DWARFInfo for DWARFv5 doesn't completely explode.
            dwarf = elf.get_dwarf_info()
            self.assertIsNotNone(dwarf)


if __name__ == '__main__':
    unittest.main()