Skip to content

Commit

Permalink
Clean up whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
eliben committed Sep 26, 2024
1 parent 9b5a554 commit 59ad15e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 37 deletions.
9 changes: 5 additions & 4 deletions test/test_debuglink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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
Expand All @@ -74,4 +74,5 @@ def test_debuglink(self):
self.assertEqual(subprograms, {b'main': (0x1161, 0x52), b'addNumbers': (0x1149, 0x18)})

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

64 changes: 32 additions & 32 deletions test/testfiles_for_readelf/struct-bitfield-packed.c
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/* Generated by compiling with gcc 4.4 (or higher?) as follows:
**
** gcc -g -o file.out file.c
*/

#include <stdio.h>

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 <stdio.h>

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;
}

3 changes: 2 additions & 1 deletion test/testfiles_for_unittests/debuglink.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ int main() {

printf("Sum of %d and %d is %d\n", num1, num2, sum);
return 0;
}
}

0 comments on commit 59ad15e

Please sign in to comment.