build: added a script for generating ABI signatures from shared libraries
authorAndrew Tridgell <tridge@samba.org>
Sun, 18 Apr 2010 02:41:56 +0000 (12:41 +1000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 18 Apr 2010 05:00:37 +0000 (15:00 +1000)
buildtools/scripts/abi_gen.sh [new file with mode: 0755]

diff --git a/buildtools/scripts/abi_gen.sh b/buildtools/scripts/abi_gen.sh
new file mode 100755 (executable)
index 0000000..fa708dd
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+# generate a set of ABI signatures from a shared library
+
+SHAREDLIB="$1"
+
+GDBSCRIPT="gdb_syms.$$"
+
+(
+cat <<EOF
+set height 0
+set width 0
+EOF
+nm $SHAREDLIB | cut -c18- | egrep '^[DGTRVW]' | grep -v @ | cut -c3- | sort | while read s; do
+    echo "echo $s: "
+    echo p $s
+done
+) > $GDBSCRIPT
+
+gdb -batch -x $GDBSCRIPT $SHAREDLIB < /dev/null
+rm -f $GDBSCRIPT