svn commit: trunk/busybox/scripts

landley at busybox.net landley at busybox.net
Sun May 7 20:58:58 UTC 2006


Author: landley
Date: 2006-05-07 13:58:55 -0700 (Sun, 07 May 2006)
New Revision: 15024

Log:
Script to easily get an assembly dump of a single function.


Added:
   trunk/busybox/scripts/showasm


Changeset:
Added: trunk/busybox/scripts/showasm
===================================================================
--- trunk/busybox/scripts/showasm	2006-05-07 20:20:34 UTC (rev 15023)
+++ trunk/busybox/scripts/showasm	2006-05-07 20:58:55 UTC (rev 15024)
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Copyright 2006 Rob Landley <rob at landley.net>
+# Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+
+# 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"
+


Property changes on: trunk/busybox/scripts/showasm
___________________________________________________________________
Name: svn:executable
   + *




More information about the busybox-cvs mailing list