Skip to content

Commit

Permalink
clean dup check
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v committed Mar 27, 2024
1 parent f02e2c7 commit c11ee7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def print_all_addresses(addresses):
def format_address(address):
return "\n".join(format_addresses(elf, [address]))

lastepc = 0
lastaddr = {}
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 @@ -146,9 +146,9 @@ def format_address(address):
name, addr = pair.split("=")
if name in ["epc1", "excvaddr"]:
addr = addr.rstrip(',')
if lastepc != addr:
if not name in lastaddr or lastaddr[name] != addr:
if addr != '0x00000000':
lastepc = addr
lastaddr[name] = addr
output = format_address(addr)
if output:
print(f"{name}={output}")
Expand Down

0 comments on commit c11ee7c

Please sign in to comment.