Skip to content

Commit 39438ba

Browse files
committed
print_large_symbols: colorize symbols based on ram/flash
1 parent f20a0bc commit 39438ba

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

print_large_symbols

100644100755
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
arm-none-eabi-nm --print-size --size-sort -t d binary.elf
1+
#!/bin/bash
2+
3+
# highlight flash symbols in green
4+
5+
F="binary.elf"
6+
if [ "$1" != "" ]; then
7+
F="$1"
8+
fi
9+
10+
arm-none-eabi-nm --print-size --size-sort -t d "$F" | c++filt |
11+
python /dev/fd/3 3<<EOF
12+
import sys
13+
flashSections = set(['T', 't', 'R', 'r'])
14+
try:
15+
while True:
16+
line = raw_input()
17+
arr = line.split(' ')
18+
prefix = ''
19+
postfix = ''
20+
if len(arr) > 3 and arr[2] in flashSections:
21+
prefix = '\033[92m'
22+
postfix = '\033[0m'
23+
print prefix + line + postfix
24+
except EOFError: pass
25+
26+
EOF

0 commit comments

Comments
 (0)