Skip to content

Commit

Permalink
callstack.py: Support python3
Browse files Browse the repository at this point in the history
callstack.py is running on python2.
This commit changes supporting python3 for it.
  • Loading branch information
SPRESENSE committed Dec 1, 2022
1 parent 85db7cf commit bb5015f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sdk/tools/callstack.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
# tools/callstack.py
#
Expand Down Expand Up @@ -56,9 +56,13 @@ def main():
quit()

for line in open(argv[1], 'r'):
address, type, symbol = line[:-1].split(' ')
if type == 'T' or type == 't' or type == 'W' or type == 'w':
syms.append((int(address, 16), symbol))
try:
address, type, symbol = line[:-1].split(' ')
if type == 'T' or type == 't' or type == 'W' or type == 'w':
syms.append((int(address, 16), symbol))
except:
pass


callstack = []
for line in open(argv[2], 'r'):
Expand Down

0 comments on commit bb5015f

Please sign in to comment.