Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orNdC-0006N0-6k for pgsql-novice@arkaria.postgresql.org; Sat, 05 Nov 2022 18:10:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1orNdA-00032B-0a for pgsql-novice@arkaria.postgresql.org; Sat, 05 Nov 2022 18:10:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orNd9-000322-MU for pgsql-novice@lists.postgresql.org; Sat, 05 Nov 2022 18:10:55 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1orNd7-0006Dl-6O for pgsql-novice@lists.postgresql.org; Sat, 05 Nov 2022 18:10:54 +0000 Received: by mail-ed1-x52d.google.com with SMTP id z18so11887601edb.9 for ; Sat, 05 Nov 2022 11:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RqrFgKc6EtumWk28d4QFhIvHGp9mjoHRiaxq4bTag/U=; b=WR2HHxpk4RIf98IRV8wCqe+xL5LchJjW9AzxI/hBj8QWdSdbfxK522qdkFmhemE6Tq EXhyGMGqv5u1/POwVptpVkBqGof2CQdnkndrd5g02BNUOtm6ygwnenyVH/BBJA9wkhcJ gNGheomQRcecjLboLEQwaOIb90fTHFfp5t0lGmLL91SUMV7fcPSVEL7+VWRyqWXA2OW+ MrwNtKPY5X4g2KKj/oPSJUDOaFsutTkHmGM4Yqyx//chKZwjWCDju5nyhWCjTG05+/z3 P//gyn7RdbkdTRgzNrolOC84qyICbgedqDifAWtExOoLqfX7F8ZszGFOr+FipmRRlr46 DdAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RqrFgKc6EtumWk28d4QFhIvHGp9mjoHRiaxq4bTag/U=; b=GJNdF6dMnoJKkg004IS5y8hqnY5VHX1Wy9OyNCt9pycMMs5Da1IeejjSyqF8uRCQ2I UmxpwxpOG6ssxExbRCxeOMupXxYlgAdIPlw99vr5oVzN+PxOJswlxgqPfFtRdXAuUb4/ Veuyvmuh6JJp+AgNN62XYcR80h5NXk/kL5U4pTLe5ReBNegI1IJUqpI8Qp/6KlhXnpJF Z7pq65sWmgI7WVFCtvxFqcqgHaDC8C6xwQMjq+yhbyHttaMBDxyHX6S3e6gzwlSDOo3t HqXtQPg5FMYi22ZweXkH+GS/gGb+OLN3jV+pyP/XsqJBxdUjaF4bbtZM4+cHcT4BPlRJ KTiQ== X-Gm-Message-State: ACrzQf286gFT9sX+yFItFDnnCSFj5OUpGuhyx2/TECRBKOxflqM6GGpN jVc2eXetV8az9KDXTzIT4Z9zwrlFI/ZZawEHR2alIQz+W/A= X-Google-Smtp-Source: AMsMyM6yarl+ORamSXfJYfoX/AVa8JpsQnCfUFQiYLGc7rdiqmgEJ4VwB5FszIpwIu9f4aTmh1/jq+ghaFvzgbWZG5Y= X-Received: by 2002:a05:6402:3718:b0:453:a46c:386c with SMTP id ek24-20020a056402371800b00453a46c386cmr41773436edb.97.1667671850674; Sat, 05 Nov 2022 11:10:50 -0700 (PDT) MIME-Version: 1.0 From: mahendrakar s Date: Sat, 5 Nov 2022 23:40:38 +0530 Message-ID: Subject: debugging libpq backend code To: pgsql-novice Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello All, 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? how do I get the backend process id? Please note that ps -ef does not show backend process and also I can't run `select pg_backend_pid()` as connection is not authorized yet. Can you suggest how to debug this backend code? especially files: auth.c, auth-sasl.c in directory src/backend/libpq). Appreciate your help. Thanks, Mahendrakar.