Skip site navigation (1) Skip section navigation (2)

Re: find_typedef alternative that works on mainstream systems

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: find_typedef alternative that works on mainstream systems
Date: 2008-01-29 01:42:17
Message-ID: 200801290142.m0T1gHw14260@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera wrote:
> 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 } }
> '

objdump errors on the -W option here (returns -1) so put some
conditional logic in tools/find_typedef and we should be fine.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-hackers by date

Next:From: Joe ConwayDate: 2008-01-29 01:59:45
Subject: Re: RFC: array_agg() per SQL:200n
Previous:From: Ron MayerDate: 2008-01-29 00:13:09
Subject: Re: [PATCHES] Proposed patch: synchronized_scanning GUCvariable

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group