summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-05-07 20:58:55 +0000
committerRob Landley <rob@landley.net>2006-05-07 20:58:55 +0000
commita336e7cc25703fef6a95238325e3521b32654b0a (patch)
treebbd7a02ca46d1f967d0535c94d5993d4848864ad /scripts
parenta3896511152cd5dcd64d2eb4aebcce65b29c6c0b (diff)
downloadbusybox-w32-a336e7cc25703fef6a95238325e3521b32654b0a.tar.gz
busybox-w32-a336e7cc25703fef6a95238325e3521b32654b0a.tar.bz2
busybox-w32-a336e7cc25703fef6a95238325e3521b32654b0a.zip
Script to easily get an assembly dump of a single function.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/showasm21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/showasm b/scripts/showasm
new file mode 100755
index 000000000..046442653
--- /dev/null
+++ b/scripts/showasm
@@ -0,0 +1,21 @@
1#!/bin/sh
2
3# Copyright 2006 Rob Landley <rob@landley.net>
4# Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
5
6# Dumb little utility function to print out the assembly dump of a single
7# function, or list the functions so dumpable in an executable. You'd think
8# there would be a way to get objdump to do this, but I can't find it.
9
10[ $# -lt 1 ] || [ $# -gt 2 ] && { echo "usage: showasm file function"; exit 1; }
11
12[ ! -f $1 ] && { echo "File $1 not found"; exit 1; }
13
14if [ $# -eq 1 ]
15then
16 objdump -d $1 | sed -n -e 's/^[0-9a-fA-F]* <\(.*\)>:$/\1/p'
17 exit 0
18fi
19
20objdump -d $1 | sed -n -e '/./{H;$!d}' -e "x;/^.[0-9a-fA-F]* <$2>:/p"
21