Re: How is the PostgreSQL debuginfo file generated

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Rui Hai Jiang <ruihaijiang(at)msn(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How is the PostgreSQL debuginfo file generated
Date: 2017-11-24 02:03:51
Message-ID: CAMsr+YH0yN74inbcgfF7Rb_TZPuRitX-JTqCvP3aRH8aUg8ZxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23 November 2017 at 18:38, Rui Hai Jiang <ruihaijiang(at)msn(dot)com> wrote:

> Hello hackers,
>
>
>
> I’m wondering how to build the debuginfo package from the PostgreSQL
> source.
>
>
>
> For example to generate something like this one :
> postgresql91-debuginfo.x86_64.
>
>
>
> Is there existing support in the current PostgreSQL Makefiles to generate
> such debuginfo? I have searched in the source code and could find anything.
> How were the existing debuginfo packages created?
>
>
>
When you're building from source, no separate debuginfo is produced. If you
build with --enable-debug, the debuginfo is embedded in the binaries. The
resulting binaries are very large but not generally any slower.

Packaging systems have helper programs that invoke 'strip' (or sometimes
objcopy) to split out the debuginfo into a separate file and remove it from
the original executable. See
https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html and
https://fedoraproject.org/wiki/Packaging:Debuginfo?rd=Packaging/Debuginfo .

You cannot generally re-create debuginfo to match a given binary package.
You'd have to rebuild in an absolutely identical environment: exact same
library versions, compiler version, configure flags, etc etc etc. Otherwise
you'll get broken/misleading debuginfo.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-11-24 02:45:06 Re: [HACKERS] INSERT ON CONFLICT and partitioned tables
Previous Message Craig Ringer 2017-11-24 01:57:17 Re: Failed to delete old ReorderBuffer spilled files