3 # $PostgreSQL: pgsql/src/tools/find_typedef,v 1.6 2006/03/11 04:38:41 momjian Exp $
5 # This script attempts to find all typedef's in the postgres binaries
6 # by using 'nm' to report all typedef debugging symbols.
8 # For this program to work, you must have compiled all binaries with
11 # This is run on BSD/OS 4.0, so you may need to make changes.
13 # Ignore the nm errors about a file not being a binary file.
15 # Remember, debugging symbols are your friends.
18 if [ "$#" -eq 0 -o ! -d "$1" ]
19 then echo "Usage: $0 postgres_binary_directory [...]" 1>&2
25 objdump --stabs "$DIR"/* |
29 sed 's/^\([^:]*\).*$/\1/' |
30 grep -v ' ' # some typedefs have spaces, remove them
34 # these are used both for typedefs and variable names
35 # so do not include them
36 egrep -v '^(date|interval|timestamp|ANY)$' |
37 sed 's/\(.*\)/-T\1 \\/'