973a90f2aa
This is in preparation for ESP32-S3 support and potentially others. Related to #4363
25 lines
699 B
Python
25 lines
699 B
Python
"""Simple script that translates "Backtrace:" lines from the ESP output to files
|
|
and line numbers.
|
|
|
|
Run with: python3 tools/decode_backtrace.py <board>
|
|
|
|
Enter the backtrace line at the "? " prompt. CTRL-C to exit the script.
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
board = sys.argv[1]
|
|
print(board)
|
|
|
|
while True:
|
|
addresses = input("? ")
|
|
if addresses.startswith("Backtrace:"):
|
|
addresses = addresses[len("Backtrace:") :]
|
|
addresses = addresses.strip().split()
|
|
addresses = [address.split(":")[0] for address in addresses]
|
|
print("got", addresses)
|
|
subprocess.run(
|
|
["xtensa-esp32s2-elf-addr2line", "-e", "build-{}/firmware.elf".format(board)] + addresses
|
|
)
|