]> arthur.barton.de Git - netatalk.git/blob - abigen.sh
Writing metadata xattr on directories with sticky bit set, FR#94
[netatalk.git] / abigen.sh
1 #!/bin/sh
2 # generate a set of ABI signatures from a shared library
3
4 SHAREDLIB="$1"
5
6 GDBSCRIPT="gdb_syms.$$"
7
8 (
9 cat <<EOF
10 set height 0
11 set width 0
12 EOF
13 nm "$SHAREDLIB" | cut -d' ' -f2- | egrep '^[BDGTRVWS]' | grep -v @ | cut -c3- | egrep -v '^[_]' | sort | while read s; do
14     echo "echo $s: "
15     echo p $s
16 done
17 ) > $GDBSCRIPT
18
19 # forcing the terminal avoids a problem on Fedora12
20 TERM=none gdb -batch -x $GDBSCRIPT "$SHAREDLIB" < /dev/null | sed -e 's/:\$[0-9]* = /: /g' -e 's/<[0-9a-zA-Z_]*>$//g' -e 's/0x[0-9a-f]* $//g' -e 's/0x[[:xdigit:]]* \("[[:alnum:] _-]*"\)/\1/g' -e 's/0x[[:xdigit:]]* \(<[[:alnum:] _-]*>\)/\1/g' -e 's/{\(.*\)} $/\1/g'
21 rm -f $GDBSCRIPT