Mercurial > hg > toybox
comparison scripts/showasm @ 41:a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 26 Nov 2006 18:47:14 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
40:d046f8d1401e | 41:a43bdc6f53af |
---|---|
1 #!/bin/sh | |
2 | |
3 # Copyright 2006 Rob Landley <rob@landley.net> | |
4 | |
5 # Dumb little utility function to print out the assembly dump of a single | |
6 # function, or list the functions so dumpable in an executable. You'd think | |
7 # there would be a way to get objdump to do this, but I can't find it. | |
8 | |
9 [ $# -lt 1 ] || [ $# -gt 2 ] && { echo "usage: showasm file function"; exit 1; } | |
10 | |
11 [ ! -f $1 ] && { echo "File $1 not found"; exit 1; } | |
12 | |
13 if [ $# -eq 1 ] | |
14 then | |
15 objdump -d $1 | sed -n -e 's/^[0-9a-fA-F]* <\(.*\)>:$/\1/p' | |
16 exit 0 | |
17 fi | |
18 | |
19 objdump -d $1 | sed -n -e '/./{H;$!d}' -e "x;/^.[0-9a-fA-F]* <$2>:/p" | |
20 |