public inbox for [email protected]  
help / color / mirror / Atom feed
From: Lana ABADIE <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: printing PGresult content with gdb
Date: Thu, 4 Jul 2024 18:11:40 +0200
Message-ID: <trinity-ad245337-3615-4511-ae0f-293359d4eef9-1720109500405@3c-app-mailcom-bs07> (raw)
In-Reply-To: <[email protected]>
References: <trinity-3ee0d178-9734-4afd-8657-c348e860763e-1719936784801@3c-app-mailcom-bs16>
	<[email protected]>

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>&nbsp;</div>

<div>&nbsp;
<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Envoy&eacute;:</b>&nbsp;mercredi 3 juillet 2024 &agrave; 17:55<br/>
<b>De:</b>&nbsp;&quot;Tom Lane&quot; &lt;[email protected]&gt;<br/>
<b>&Agrave;:</b>&nbsp;[email protected]<br/>
<b>Cc:</b>&nbsp;[email protected]<br/>
<b>Objet:</b>&nbsp;Re: printing PGresult content with gdb</div>

<div name="quoted-content">[email protected] writes:<br/>
&gt; I don&#39;t know if it is the right mailing list, but i was<br/>
&gt; wondering if one could introspect via gdb the content of PGresult.<br/>
<br/>
You might have better luck with that if you install the debuginfo<br/>
RPM corresponding to your libpq RPM. PGresult&#39;s innards are not<br/>
exposed to applications by libpq-fe.h, so your own app&#39;s debug<br/>
data is not going to contain the details of the struct. But I think<br/>
it would be available to gdb if libpq&#39;s debug symbols were installed.<br/>
<br/>
regards, tom lane</div>

<div name="quoted-content">&nbsp;</div>

<div name="quoted-content">thanks Tom</div>

<div name="quoted-content">Indeed installing the debuginfo rpm on my system solves the issue, i could print the content</div>

<div name="quoted-content">see trace below</div>

<div name="quoted-content">
<pre>(gdb) p *res
&#36;2 = {ntups = 0, numAttributes = 0, attDescs = 0x0, tuples = 0x0, tupArrSize = 0, numParameters = 0, paramDescs = 0x0, resultStatus = PGRES_FATAL_ERROR,&nbsp;
&nbsp; cmdStatus = &quot;&#92;000ELECT 3&#92;000&#92;061&quot;, &#39;&#92;000&#39; &lt;repeats 53 times&gt;, binary = 0, noticeHooks = {noticeRec = 0x7f0731f40770 &lt;defaultNoticeReceiver&gt;, noticeRecArg = 0x0,&nbsp;
&nbsp; &nbsp; noticeProc = 0x7f0731f40500 &lt;defaultNoticeProcessor&gt;, noticeProcArg = 0x0}, events = 0x0, nEvents = 0, client_encoding = 6,&nbsp;
&nbsp; errMsg = 0x7f07180076e8 &quot;server closed the connection unexpectedly&#92;n&#92;tThis probably means the server terminated abnormally&#92;n&#92;tbefore or while processing the request.&#92;n&quot;,&nbsp;
&nbsp; errFields = 0x0, errQuery = 0x0, null_field = &quot;&quot;, curBlock = 0x7f07180076e0, curOffset = 146, spaceLeft = 1902, memorySize = 2264}</pre>
</div>
</div>
</div>
</div></div></body></html>






view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: printing PGresult content with gdb
  In-Reply-To: <trinity-ad245337-3615-4511-ae0f-293359d4eef9-1720109500405@3c-app-mailcom-bs07>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox