8000 Stack decoder script by mcspr · Pull Request #8661 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Stack decoder script #8661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
capture
  • Loading branch information
mcspr committed Aug 23, 2022
commit 305f910d2946250b9d35c9a52239c6fb9f2b02ac
8 changes: 5 additions & 3 deletions tools/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def print_all_addresses(addresses):
print(formatted)
return list()

def format_address(address):
return "\n".join(format_addresses(elf, [address]))

for line in lines:
# ctx could happen multiple times. for the 2nd one, reset list
# ctx: bearssl *or* ctx: cont *or* ctx: sys *or* ctx: whatever
Expand All @@ -136,7 +139,7 @@ def print_all_addresses(addresses):
for pair in pairs:
name, addr = pair.split("=")
if name in ["epc1", "excvaddr"]:
output = "\n".join(format_addresses(elf, [addr]))
output = format_address(addr)
if output:
print(f"{name}={output}")
# Exception (123):
Expand All @@ -149,9 +152,8 @@ def print_all_addresses(addresses):
values = LAST_ALLOC_RE.match(line)
if values:
addr, size = values.groups()
output = "\n".join(format_addresses(elf, [addr]))
print()
print(f"Allocation of {size} bytes failed: {output}")
print(f"Allocation of {size} bytes failed: {format_address(addr)}")
# postmortem guards our actual stack dump values with these
elif ">>>stack>>>" in line:
in_stack = True
Expand Down
0