()
| 58 | |
| 59 | |
| 60 | def parse_nm() -> list[tuple[int, int, str, str]]: |
| 61 | out = subprocess.check_output( |
| 62 | [str(NM), "--print-size", "--size-sort", "--radix=d", str(ELF)], text=True |
| 63 | ) |
| 64 | syms: list[tuple[int, int, str, str]] = [] |
| 65 | for line in out.splitlines(): |
| 66 | parts = line.split(maxsplit=3) |
| 67 | if len(parts) < 4: |
| 68 | continue |
| 69 | try: |
| 70 | syms.append((int(parts[0]), int(parts[1]), parts[2], parts[3])) |
| 71 | except ValueError: |
| 72 | continue |
| 73 | return syms |
| 74 | |
| 75 | |
| 76 | def addr2line_batch(addrs: list[int]) -> dict[int, str]: |