Re: Using fmgr_hook - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Using fmgr_hook
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D2E4F5@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: Using fmgr_hook  (Sameer Thakur <samthakur74@gmail.com>)
Responses Re: Using fmgr_hook  (Sameer Thakur <samthakur74@gmail.com>)
List pgsql-general
Sameer Thakur wrote:
>> My experience is that you cannot set breakpoints before the library
>> is loaded, so you first have to call a function in the library, then
>> you interrupt and set the breakpoint.

> I tried to do the following
> 1. Execute Postgres (now auto_explain is loaded)
> 2. Start a psql session and attach gdb to forked Postmaster process
> 3. Now set break point in custom_fmgr_hook
> 4. Execute select * from now();
> 
> Still the breakpoint gets skipped.

But gdb tells you that it cannot set the breakpoint correctly
when you try to, right?

Try like this:
- connect with psql
- call your custom_fmgr_hook
- attach to the backend with gdb
- set the breakpoint
- call custom_fmgr_hook again

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: K P Manoj
Date:
Subject: Re: PostgreSQL DB Replication
Next
From: Soni M
Date:
Subject: Re: Restart replicated slave procedure