View Single Post

   
  #1 (permalink)  
Old 04-15-2008, 11:42 PM
Alvaro Herrera
 
Posts: n/a
Default find_typedef alternative that works on mainstream systems

Hi,

I just came across objdump -W which dumps the DWARF info from a object
file. This is useful to build a typedef file for pgindent. It can be
used like this:

objdump -W $object_file | \
awk '/DW_TAG_/ { grab=0 } /DW_TAG_typedef/ { grab=1 } /DW_AT_name/ { if(grab) { print $0 } }' | \
sed -e 's/^.*: \([^ ]*\)/\1/' | \
sort | \
uniq

I am disappointed by the fact that our current find_typedef script only
works on Bruce's rare platforms -- and we stopped shipping a "standard"
typedef file, which makes the problem worse.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHlVhLXL3AQg41cocRAlKoAKDWdOjY6qgkedKbfTN8m7 ghdtLP3QCg0oAt
xlHiw9BxSyoQTBzKh1rA3nk=
=soa/
-----END PGP SIGNATURE-----

Reply With Quote