diff options
author | Rob Landley <rob@landley.net> | 2006-11-26 18:47:14 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-11-26 18:47:14 -0500 |
commit | cd2edfd6a13848e387f836252464de4662a22205 (patch) | |
tree | f79cef475f032832d51033291e2c95a0197e5402 /scripts/showasm | |
parent | 28a0dec5dd19458200a18609ba0cc8c2f3b4d22f (diff) | |
download | toybox-cd2edfd6a13848e387f836252464de4662a22205.tar.gz |
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Diffstat (limited to 'scripts/showasm')
-rwxr-xr-x | scripts/showasm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/showasm b/scripts/showasm new file mode 100755 index 00000000..75a6efd7 --- /dev/null +++ b/scripts/showasm @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright 2006 Rob Landley <rob@landley.net> + +# Dumb little utility function to print out the assembly dump of a single +# function, or list the functions so dumpable in an executable. You'd think +# there would be a way to get objdump to do this, but I can't find it. + +[ $# -lt 1 ] || [ $# -gt 2 ] && { echo "usage: showasm file function"; exit 1; } + +[ ! -f $1 ] && { echo "File $1 not found"; exit 1; } + +if [ $# -eq 1 ] +then + objdump -d $1 | sed -n -e 's/^[0-9a-fA-F]* <\(.*\)>:$/\1/p' + exit 0 +fi + +objdump -d $1 | sed -n -e '/./{H;$!d}' -e "x;/^.[0-9a-fA-F]* <$2>:/p" + |