Search Postgresql Archives

Re: printing PGresult content with gdb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
 
 
Envoyé: mercredi 3 juillet 2024 à 17:55
De: "Tom Lane" <tgl@xxxxxxxxxxxxx>
À: clipperDB@xxxxxx
Cc: pgsql-general@xxxxxxxxxxxxxxxxxxxx
Objet: Re: printing PGresult content with gdb
clipperDB@xxxxxx 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}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux