Re: find_typedef alternative that works on mainstream systems - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: find_typedef alternative that works on mainstream systems
Date
Msg-id 20080122030508.GB20416@alvh.no-ip.org
Whole thread Raw
In response to find_typedef alternative that works on mainstream systems  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: find_typedef alternative that works on mainstream systems  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Alvaro Herrera wrote:

> 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 oversimplified the awk line, causing some garbage to appear at the end
:-(  The full awk line I am using is 

awk '
/^Contents of / { if (read) exit }
/^The section / { if (read) exit }
/^The section .debug_info contains:/ { read=1 }
/DW_TAG_/ { grab=0 }
/DW_TAG_typedef/ { grab=1 }
/DW_AT_name/ { if (read && grab) { print $0 } }
'

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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: find_typedef alternative that works on mainstream systems
Next
From: cinu
Date:
Subject: Errors with run_build.pl - 8.3RC2