Re: debugging libpq backend code - Mailing list pgsql-novice

From Tom Lane
Subject Re: debugging libpq backend code
Date
Msg-id 2732738.1667677179@sss.pgh.pa.us
Whole thread Raw
In response to debugging libpq backend code  (mahendrakar s <mahendrakarforpg@gmail.com>)
List pgsql-novice
mahendrakar s <mahendrakarforpg@gmail.com> writes:
> I'm trying to debug libpq backend code (files: auth.c, auth-sasl.c in
> directory src/backend/libpq).
> I followed: Developer FAQ - PostgreSQL wiki and attached postgres
> process ( because connection is still in progress and I don't see
> backend process yet when I try to connect through psql). I could set
> the break-points but these are not hit while it must. I think I should
> not be attaching postmaster parent process instead attach the backend
> process but how?

The traditional answer is to set pre_auth_delay high enough to give
yourself time to identify the new backend process (via "ps") and
attach to it in gdb.

You might also be able to attach to the postmaster in gdb and
persuade it to follow the fork(), but I'm not very sure about
the details of making that work while not complicating your
life with a bunch of other postmaster children.

            regards, tom lane



pgsql-novice by date:

Previous
From: mahendrakar s
Date:
Subject: debugging libpq backend code
Next
From: Ankit Kumar Pandey
Date:
Subject: Todo item: distinct clause - guidance