Skip to content

Commit

Permalink
Fixed return statement of addr2line
Browse files Browse the repository at this point in the history
  • Loading branch information
NikosDelijohn committed Oct 15, 2024
1 parent 2288703 commit 9bb96b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/testcrush/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def zip_archive(archive_name: str, *files) -> str:
return zip_filename


def addr2line(elf_file: pathlib.Path, pc_address: str) -> tuple[int, str] | None:
def addr2line(elf_file: pathlib.Path, pc_address: str) -> tuple[str, int] | None:
"""
Mimics the functionality of the addr2line binutil using pyelftools.
Takes an ELF file and an address, and returns the corresponding
Expand Down Expand Up @@ -176,7 +176,7 @@ def addr2line(elf_file: pathlib.Path, pc_address: str) -> tuple[int, str] | None

file_name = line_program['file_entry'][state.file - 1].name

return (pathlib.Path(file_name.decode('utf-8')).resolve(), {state.line})
return (file_name.decode('utf-8'), int(state.line))

return None

Expand Down

0 comments on commit 9bb96b2

Please sign in to comment.