Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
012786aa
Commit
012786aa
authored
Dec 21, 2007
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update find_typedefs to handle simple 'typedef X' cases, per request
from Tom.
parent
51a5921d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
src/tools/find_typedef
src/tools/find_typedef
+18
-6
No files found.
src/tools/find_typedef
View file @
012786aa
#!/bin/sh
#!/bin/sh
# $PostgreSQL: pgsql/src/tools/find_typedef,v 1.
7 2007/12/21 14:20:36
momjian Exp $
# $PostgreSQL: pgsql/src/tools/find_typedef,v 1.
8 2007/12/21 21:02:41
momjian Exp $
# This script attempts to find all typedef's in the postgres binaries
# This script attempts to find all typedef's in the postgres binaries
# by using 'nm' to report all typedef debugging symbols.
# by using 'nm' to report all typedef debugging symbols.
...
@@ -12,8 +12,23 @@
...
@@ -12,8 +12,23 @@
#
#
# Ignore the nm errors about a file not being a binary file.
# Ignore the nm errors about a file not being a binary file.
#
#
#
Remember, debugging symbols are your friends.
#
It gets typedefs by reading "STABS":
#
#
# http://www.informatik.uni-frankfurt.de/doc/texi/stabs_toc.html
#
# objdump:
# -G, --stabs Display (in raw form) any STABS info in the file
#
# --stabs
# Display the contents of the .stab, .stab.index, and
# .stab.excl sections from an ELF file. This is only
# useful on systems (such as Solaris 2.0) in which
# .stab debugging symbol-table entries are carried in
# an ELF section. In most other file formats, debug-
# ging symbol-table entries are interleaved with
# linkage symbols, and are visible in the --syms out-
# put.
if
[
"$#"
-eq
0
-o
!
-d
"
$1
"
]
if
[
"$#"
-eq
0
-o
!
-d
"
$1
"
]
then
echo
"Usage:
$0
postgres_binary_directory [...]"
1>&2
then
echo
"Usage:
$0
postgres_binary_directory [...]"
1>&2
...
@@ -23,10 +38,7 @@ fi
...
@@ -23,10 +38,7 @@ fi
for
DIR
for
DIR
do
do
objdump
--stabs
"
$DIR
"
/
*
|
objdump
--stabs
"
$DIR
"
/
*
|
grep
"LSYM"
|
awk
' $2 == "LSYM" && $7 ~ /:[tT]/ {sub(":.*", "", $7); print $7}'
|
awk
'{print $7}'
|
grep
':t'
|
sed
's/^\([^:]*\).*$/\1/'
|
grep
-v
' '
# some typedefs have spaces, remove them
grep
-v
' '
# some typedefs have spaces, remove them
done
|
done
|
sort
|
sort
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment