Re: find_typedef alternative that works on mainstream systems

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: find_typedef alternative that works on mainstream systems
Date: 2008-01-22 03:05:08
Message-ID: 20080122030508.GB20416@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message kids 2008-01-22 03:46:16 Re: Pl/Java broken since Postgresql 8.3-rc1
Previous Message Alvaro Herrera 2008-01-22 02:43:23 find_typedef alternative that works on mainstream systems