Re: Debugging extension with gdb?

From: Paul Jones <pbj(at)cmicdo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Debugging extension with gdb?
Date: 2013-11-20 22:11:01
Message-ID: 1384985461.48378.YahooMailNeo@web122205.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>________________________________
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>To: Paul Jones <pbj(at)cmicdo(dot)com>
>Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
>Sent: Wednesday, November 20, 2013 9:13 AM
>Subject: Re: [GENERAL] Debugging extension with gdb?
>
>
>Paul Jones <pbj(at)cmicdo(dot)com> writes:
>
>> Can someone point me to information on how to debug a Postgres extension
>> with gdb?
>
>I've noticed that on some platforms, it works better to attach gdb to the
>backend process before you load the extension, but on others, it works
>better to attach afterwards.  You might try the opposite procedure from
>whatever you were doing.  Other than that, it's mostly Just Worked for
>me on any remotely modern platform.  Be sure both the backend and the
>extension are compiled with -g, of course.
>
>            regards, tom lane

After I *carefully* re-read your mail, I realized that I did not have
the entire postgresql compiled with '-g'.  So I went back and re-built
all of it and, behold, I set and caught a breakpoint in the extension.

Thanks!
PJ

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joey Quinn 2013-11-20 23:20:32 Re: hstore
Previous Message John R Pierce 2013-11-20 21:59:15 Re: hstore