Skip to content

Commit 012786a

Browse files
committed
Update find_typedefs to handle simple 'typedef X' cases, per request
from Tom.
1 parent 51a5921 commit 012786a

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/tools/find_typedef

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# $PostgreSQL: pgsql/src/tools/find_typedef,v 1.7 2007/12/21 14:20:36 momjian Exp $
3+
# $PostgreSQL: pgsql/src/tools/find_typedef,v 1.8 2007/12/21 21:02:41 momjian Exp $
44

55
# This script attempts to find all typedef's in the postgres binaries
66
# by using 'nm' to report all typedef debugging symbols.
@@ -12,8 +12,23 @@
1212
#
1313
# Ignore the nm errors about a file not being a binary file.
1414
#
15-
# Remember, debugging symbols are your friends.
15+
# It gets typedefs by reading "STABS":
1616
#
17+
# http://www.informatik.uni-frankfurt.de/doc/texi/stabs_toc.html
18+
#
19+
# objdump:
20+
# -G, --stabs Display (in raw form) any STABS info in the file
21+
#
22+
# --stabs
23+
# Display the contents of the .stab, .stab.index, and
24+
# .stab.excl sections from an ELF file. This is only
25+
# useful on systems (such as Solaris 2.0) in which
26+
# .stab debugging symbol-table entries are carried in
27+
# an ELF section. In most other file formats, debug-
28+
# ging symbol-table entries are interleaved with
29+
# linkage symbols, and are visible in the --syms out-
30+
# put.
31+
1732

1833
if [ "$#" -eq 0 -o ! -d "$1" ]
1934
then echo "Usage: $0 postgres_binary_directory [...]" 1>&2
@@ -23,10 +38,7 @@ fi
2338
for DIR
2439
do
2540
objdump --stabs "$DIR"/* |
26-
grep "LSYM" |
27-
awk '{print $7}' |
28-
grep ':t' |
29-
sed 's/^\([^:]*\).*$/\1/' |
41+
awk ' $2 == "LSYM" && $7 ~ /:[tT]/ {sub(":.*", "", $7); print $7}' |
3042
grep -v ' ' # some typedefs have spaces, remove them
3143
done |
3244
sort |

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy