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 TestAttrFormFlagPresent(unittest
.TestCase
):
14 def test_form_flag_present_value_is_true(self
):
15 with
open(os
.path
.join('test', 'testfiles_for_unittests',
16 'lambda.elf'), 'rb') as f
:
18 self
.assertTrue(elffile
.has_dwarf_info())
20 dwarf
= elffile
.get_dwarf_info()
21 for cu
in dwarf
.iter_CUs():
22 for die
in cu
.iter_DIEs():
23 for _
, attr
in die
.attributes
.items():
24 if attr
.form
== "DW_FORM_flag_present":
25 self
.assertTrue(attr
.value
)