diff --git a/test/test_debuglink.py b/test/test_debuglink.py index 71592887..b12baa69 100644 --- a/test/test_debuglink.py +++ b/test/test_debuglink.py @@ -35,7 +35,7 @@ def subprograms_from_debuglink(self, elf: ELFFile) -> dict[str, (int, int)]: debug file. Args: elf (ELFFile): The ELF file. - + Returns: dict: A dictionary containing the subprograms of the specified ELF file. """ @@ -58,8 +58,8 @@ def subprograms_from_debuglink(self, elf: ELFFile) -> dict[str, (int, int)]: if highpc_attr.form == 'DW_FORM_addr': # highpc is an absolute address size = highpc_attr.value - lowpc - elif highpc_attr.form in {'DW_FORM_data2','DW_FORM_data4', - 'DW_FORM_data8', 'DW_FORM_data1', + elif highpc_attr.form in {'DW_FORM_data2','DW_FORM_data4', + 'DW_FORM_data8', 'DW_FORM_data1', 'DW_FORM_udata'}: # highpc is an offset from lowpc size = highpc_attr.value @@ -74,4 +74,5 @@ def test_debuglink(self): self.assertEqual(subprograms, {b'main': (0x1161, 0x52), b'addNumbers': (0x1149, 0x18)}) if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() + diff --git a/test/testfiles_for_readelf/struct-bitfield-packed.c b/test/testfiles_for_readelf/struct-bitfield-packed.c index 40d7076b..f8c23c25 100644 --- a/test/testfiles_for_readelf/struct-bitfield-packed.c +++ b/test/testfiles_for_readelf/struct-bitfield-packed.c @@ -1,32 +1,32 @@ -/* Generated by compiling with gcc 4.4 (or higher?) as follows: -** -** gcc -g -o file.out file.c -*/ - -#include - -struct def -{ - int ijk; - char c; - long long lint; - float mno; - int bit1 : 1; - int bit3 : 3; - int bit2 : 2; - int bit4 : 4; -//}; -}__attribute__((__packed__)); - -const int GLOBAL_CONST; - -int tryGlobal; -struct def hiLo; - -int main() -{ - int abc; - printf("Hello World\n"); - return 0; -} - +/* Generated by compiling with gcc 4.4 (or higher?) as follows: +** +** gcc -g -o file.out file.c +*/ + +#include + +struct def +{ + int ijk; + char c; + long long lint; + float mno; + int bit1 : 1; + int bit3 : 3; + int bit2 : 2; + int bit4 : 4; +//}; +}__attribute__((__packed__)); + +const int GLOBAL_CONST; + +int tryGlobal; +struct def hiLo; + +int main() +{ + int abc; + printf("Hello World\n"); + return 0; +} + diff --git a/test/testfiles_for_unittests/debuglink.c b/test/testfiles_for_unittests/debuglink.c index 38401d2f..d9cfdbd0 100644 --- a/test/testfiles_for_unittests/debuglink.c +++ b/test/testfiles_for_unittests/debuglink.c @@ -11,4 +11,5 @@ int main() { printf("Sum of %d and %d is %d\n", num1, num2, sum); return 0; -} \ No newline at end of file +} +