INNER CODE UNIT · Python
decode_lines
xoseperez/espurna · code/scripts/decoder.py:127
def decode_lines(
format_addresses: Formatter, elf: pathlib.Path, lines: fileinput.FileInput
):
ANY_ADDR_RE = re.compile(r"0x[0-9a-fA-F]{8}|[0-9a-fA-F]{8}")
MEM_ERR_LINE_RE = re.compile(r"^(Stack|last failed alloc call)")
STACK_LINE_RE = re.compile(r"^[0-9a-f]{8}:\s\s+")
IGNORE_FIRMWARE_RE = re.compile(r"^(epc1=0x........, |Fatal exception )")
CUT_HERE_STRING = "CUT HERE FOR EXCEPTION DECODER"
DECODE_IT = "DECODE IT"
EXCEPTION_STRING = "Exception ("
EPC_STRING = "epc1="
# either print everything as-is, or cache current string and dump after stack contents end
last_stack = None