Re: typedefs for indent

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: typedefs for indent
Date: 2009-03-22 20:27:42
Message-ID: 17119.1237753662@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

After doing some further digging I've concluded that the typedefs that
are missing from dungbeetle's list are those that are declared, but are
never used as the type of anything. For instance
AfterTriggerEventDataOneCtid is only used in a sizeof() computation,
and there are quite a few enums for which no variable is ever declared
as being of the enum type. So Alvaro seems to be right that these are
getting optimized out of the debug info. The good news is that as far
as I can think at the moment, that means we don't really care whether
pg_indent knows they are typedef names or not --- they aren't getting
used in any contexts where it would matter for indenting purposes.

However, this does complicate the matter of comparing the typedef
lists to identify how many symbols are platform-specific or
compile-option-specific typedefs.

BTW, is dungbeetle still running Fedora 6? On my F-10 machine the
output of objdump seems to be formatted differently than your script
is expecting, eg

$ objdump -W postgres | egrep -A3 '(DW_TAG_typedef|DW_TAG_structure_type|DW_TAG_union_type)' | grep AfterTriggerEvent
<19ac75> DW_AT_name : (indirect string, offset: 0x1c1ad): AfterTriggerEvent
<19ac87> DW_AT_name : (indirect string, offset: 0x1bffc): AfterTriggerEventData
<19acc2> DW_AT_name : (indirect string, offset: 0x1bffc): AfterTriggerEventData
<19acce> DW_AT_name : (indirect string, offset: 0x1c891): AfterTriggerEventChunk
<19ad1e> DW_AT_name : (indirect string, offset: 0x1c891): AfterTriggerEventChunk
<19ad2a> DW_AT_name : (indirect string, offset: 0x1c166): AfterTriggerEventList
<19ad6b> DW_AT_name : (indirect string, offset: 0x1c166): AfterTriggerEventList

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-03-22 21:05:01 Re: contrib function naming, and upgrade issues
Previous Message Dimitri Fontaine 2009-03-22 20:27:20 Re: contrib function naming, and upgrade issues