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