printing PGresult content with gdb

From: clipperDB(at)gmx(dot)fr
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: printing PGresult content with gdb
Date: 2024-07-02 16:13:04
Message-ID: trinity-3ee0d178-9734-4afd-8657-c348e860763e-1719936784801@3c-app-mailcom-bs16
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

<div class="signature">Hi all</div>

<div class="signature">I don&#39;t know if it is the right mailing list, but i was wondering if one could introspect via gdb the content of PGresult.</div>

<div class="signature">In my case i got a coredump and when i tried to analyze the core and try to print the content of PGresult i got incomplete type</div>

<div class="signature">I&#39;m using libpq-13.3 (installed via libpq-13.3-1.el8_4.x86_64, RHEL8.5). Any help would be appreciated (i&#39;m trying to get the errMesg value of this field)</div>

<div class="signature">(gdb) p res<br/>
&#36;1 = (PGresult *) 0x7f0718000b80<br/>
(gdb) p *res<br/>
&#36;2 = &lt;incomplete type&gt;<br/>
(gdb) ptype res<br/>
type = struct pg_result {<br/>
&nbsp; &nbsp; &lt;incomplete type&gt;<br/>
} *<br/>
(gdb) explore res<br/>
&#39;res&#39; is a pointer to a value of type &#39;PGresult&#39;<br/>
Continue exploring it as a pointer to a single value [y/n]: y<br/>
The value of &#39;*res&#39; is of type &#39;PGresult&#39; which is a typedef of type &#39;pg_result&#39;<br/>
The value of &#39;*res&#39; is a struct/class of type &#39;pg_result&#39; with no fields.<br/>
(gdb)&nbsp;<br/>
thanks for your hints</div>

<div class="signature">doris</div></div></body></html>

Attachment Content-Type Size
unknown_filename text/html 1.3 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2024-07-02 21:47:12 Accommodating alternative column values
Previous Message yudhi s 2024-07-02 07:54:07 Re: Question on partman extension while relation exist