1 #-------------------------------------------------------------------------------
4 # Eli Bendersky (eliben@gmail.com), Santhosh Kumar Mani (santhoshmani@gmail.com)
5 # This code is in the public domain
6 #-------------------------------------------------------------------------------
10 from elftools
.elf
.elffile
import ELFFile
13 class TestRangeLists(unittest
.TestCase
):
14 # Test the absence of .debug_ranges section
15 def test_range_list_absence(self
):
16 with
open(os
.path
.join('test', 'testfiles_for_unittests',
17 'arm_with_form_indirect.elf'), 'rb') as f
:
19 self
.assertTrue(elffile
.has_dwarf_info())
20 self
.assertIsNone(elffile
.get_dwarf_info().range_lists())
22 # Test the presence of .debug_ranges section
23 def test_range_list_presence(self
):
24 with
open(os
.path
.join('test', 'testfiles_for_unittests',
25 'sample_exe64.elf'), 'rb') as f
:
27 self
.assertTrue(elffile
.has_dwarf_info())
28 self
.assertIsNotNone(elffile
.get_dwarf_info().range_lists())
31 if __name__
== '__main__':