Skip to content

Commit

Permalink
print_large_symbols: colorize symbols based on ram/flash
Browse files Browse the repository at this point in the history
  • Loading branch information
nanovna committed Mar 8, 2020
1 parent f20a0bc commit 39438ba
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion print_large_symbols
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
arm-none-eabi-nm --print-size --size-sort -t d binary.elf
#!/bin/bash

# highlight flash symbols in green

F="binary.elf"
if [ "$1" != "" ]; then
F="$1"
fi

arm-none-eabi-nm --print-size --size-sort -t d "$F" | c++filt |
python /dev/fd/3 3<<EOF
import sys
flashSections = set(['T', 't', 'R', 'r'])
try:
while True:
line = raw_input()
arr = line.split(' ')
prefix = ''
postfix = ''
if len(arr) > 3 and arr[2] in flashSections:
prefix = '\033[92m'
postfix = '\033[0m'
print prefix + line + postfix
except EOFError: pass
EOF

0 comments on commit 39438ba

Please sign in to comment.