Find the ESP32 addr2line tool.
()
| 82 | |
| 83 | |
| 84 | def find_addr2line() -> Optional[Path]: |
| 85 | """Find the ESP32 addr2line tool.""" |
| 86 | # Common PlatformIO toolchain locations |
| 87 | home = Path.home() |
| 88 | |
| 89 | # Try RISC-V (ESP32-C3, C6, etc.) |
| 90 | riscv_paths = [ |
| 91 | home |
| 92 | / ".platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-addr2line", |
| 93 | home |
| 94 | / ".platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-addr2line.exe", |
| 95 | ] |
| 96 | |
| 97 | for path in riscv_paths: |
| 98 | if path.exists(): |
| 99 | return path |
| 100 | |
| 101 | # Try Xtensa (ESP32, ESP32-S2, ESP32-S3) |
| 102 | xtensa_paths = [ |
| 103 | home |
| 104 | / ".platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-addr2line", |
| 105 | home |
| 106 | / ".platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-addr2line.exe", |
| 107 | home |
| 108 | / ".platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-addr2line", |
| 109 | home |
| 110 | / ".platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-addr2line.exe", |
| 111 | ] |
| 112 | |
| 113 | for path in xtensa_paths: |
| 114 | if path.exists(): |
| 115 | return path |
| 116 | |
| 117 | return None |
| 118 | |
| 119 | |
| 120 | def decode_addresses( |
no outgoing calls
no test coverage detected