Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQjJj-00BK5x-Sq for pgsql-general@arkaria.postgresql.org; Mon, 08 Jul 2024 08:01:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sQjJi-003Izz-EL for pgsql-general@arkaria.postgresql.org; Mon, 08 Jul 2024 08:01:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPP3j-0013UP-K9 for pgsql-general@lists.postgresql.org; Thu, 04 Jul 2024 16:11:48 +0000 Received: from mout.gmx.net ([212.227.15.19]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPP3e-000Pgf-0B for pgsql-general@lists.postgresql.org; Thu, 04 Jul 2024 16:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.fr; s=s31663417; t=1720109500; x=1720714300; i=clipperdb@gmx.fr; bh=Jit4UVAq/3IXdzggXrKHMYtqgrUIFc/N30Y/S+Jr4fc=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Cc:Subject: Content-Type:Date:In-Reply-To:References:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=OmjyZ23SlLTtTs3YEgci10rV/q5RJnYul6AoQtEL+gPBagiHrx+AR3e+SSvZIcub weZYvs2xr/ZAgZgZbFpbcFCbLJkybVFQysrLBwdo5KsoYApihvcI6dqEnGcOhdMqm vMr2lc2SkSkhTghqxbFAsXULEviH2BMnqCOyfbdI5hnRZ/+85Q0Ix0LnoK59rVEH+ bJOIkxYBjKXzSWM5FraFrRrXvbH6Be1Fb5z6wVQzXJtUNwu/uEftQwZDqb713d1zQ byFZ/p2Wf6PDEKrMH7aqjvL+DiezBjl84XUdsBgJE+eIYD+P44mfY7SBevNa0mSx8 dXIY3yoiCyzKeUu/UA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [90.118.59.215] ([90.118.59.215]) by web-mail.gmx.net (3c-app-mailcom-bs07.server.lan [172.19.170.175]) (via HTTP); Thu, 4 Jul 2024 18:11:40 +0200 MIME-Version: 1.0 Message-ID: From: Lana ABADIE To: Tom Lane Cc: pgsql-general@lists.postgresql.org Subject: Re: printing PGresult content with gdb Content-Type: text/html; charset=UTF-8 Date: Thu, 4 Jul 2024 18:11:40 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <3258157.1720022101@sss.pgh.pa.us> References: <3258157.1720022101@sss.pgh.pa.us> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:0Y5aS8AgZoFGd13GUdKZOLdIpkTcgnNF4XCX2q+SZKXvFE4yji300iGwK1q+oAZGhswa7 02n+W35kmCisMwkVD4TPN+3eDwSrsOd8L8RVBw1dD0X6Z0NgPlY02cK0KU6ZFKcj7Xy3CJbjGeyU y2xOjO7skG9IRe+I4QasBqxqVyQhKlLatZIsk7rm2T3CjGVRVikEw7HdQ/YfKMlesj0VA9rTDhaQ aWnMhDWdC4YTLl6CzX6ymkrZUs+OQbmVvYVCNCg4T5zf3ymdaSYQNuaGaINQPcDAKa2GBEMKrb6Q 08= X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:VCKR1p/b9KE=;BqzOJj4iIZGQW4PO+80POYx2RFD kcCsxsnQAQuwIGY7SgqxYJ5pcC5iHN5Lx1/OPefFttzgTHUmdBvaD02j0ECeBxSg/hfS6YYtg FLGytao+wAvMP6Iocn9HzHUFcf4WQIB2DBX+086YAPkZWdvTG5ic+iJXgf+9+45N/A63a6eOO CrD2iaQzm2Kf3h162n50EC+jVAIPEMecIkfTP4BLf49IHIVinULMzysKd4FvyD2xKNx/pHSJK w+NxHVkrDOt2ERV4fva37KYWccY1q/4AkXFrVMp4u52o9Hz8bpaLkRq2UDQDIJki49iSYM+Hk UhSGfuvyEaNwe/KoRrI1y0CA/TMtAzUe6YQu7xk4gC2pCVsb8l6ugHHw02F8FLdvReVVyGZ1M 9Ww/h7b8268LgTCOQr2jr5KyTzV1UaFNXlYaO7fo2V4LcTbZ9aWZuvlze4pAOZfIWDcMsqAMK NJiXjZKkNovkt41sFg+k5DaBJdkQSLEOZkZxyoBCHnLE8EEIOxOWN0GzZR18cLbICqgHqq5Bf SZez1QURyLNrB/EMVeLSjV6CRtGuO/kOjZZR4co4nRT5dVCYr7hr7haK6QB9yjbQGBkQWIqZV bTIz26ypu0D6h7vbWAlfoIgsgddfU3k3OzZqU5hGkWhjYoImzIOnJ9h79lgqhC56XJqMrwBxv d30bh2VRClKPIaQMWyFfnmjh13+BnCh5XopAKp2705Mq3uY70Rf+Y8RWu4CPSvw= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk
 
 
 
Envoyé: mercredi 3 juillet 2024 à 17:55
De: "Tom Lane" <tgl@sss.pgh.pa.us>
À: clipperDB@gmx.fr
Cc: pgsql-general@lists.postgresql.org
Objet: Re: printing PGresult content with gdb
clipperDB@gmx.fr writes:
> I don't know if it is the right mailing list, but i was
> wondering if one could introspect via gdb the content of PGresult.

You might have better luck with that if you install the debuginfo
RPM corresponding to your libpq RPM. PGresult's innards are not
exposed to applications by libpq-fe.h, so your own app's debug
data is not going to contain the details of the struct. But I think
it would be available to gdb if libpq's debug symbols were installed.

regards, tom lane
 
thanks Tom
Indeed installing the debuginfo rpm on my system solves the issue, i could print the content
see trace below
(gdb) p *res
$2 = {ntups = 0, numAttributes = 0, attDescs = 0x0, tuples = 0x0, tupArrSize = 0, numParameters = 0, paramDescs = 0x0, resultStatus = PGRES_FATAL_ERROR, 
  cmdStatus = "\000ELECT 3\000\061", '\000' <repeats 53 times>, binary = 0, noticeHooks = {noticeRec = 0x7f0731f40770 <defaultNoticeReceiver>, noticeRecArg = 0x0, 
    noticeProc = 0x7f0731f40500 <defaultNoticeProcessor>, noticeProcArg = 0x0}, events = 0x0, nEvents = 0, client_encoding = 6, 
  errMsg = 0x7f07180076e8 "server closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n", 
  errFields = 0x0, errQuery = 0x0, null_field = "", curBlock = 0x7f07180076e0, curOffset = 146, spaceLeft = 1902, memorySize = 2264}