Re: debugging C functions - Mailing list pgsql-general

From Nigel J. Andrews
Subject Re: debugging C functions
Date
Msg-id Pine.LNX.4.21.0306201909330.29248-100000@ponder.fairway2k.co.uk
Whole thread Raw
In response to Re: debugging C functions  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: debugging C functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, 20 Jun 2003, Peter Eisentraut wrote:

> Nigel J. Andrews writes:
>
> > Attaching the debugger to the backend process I can't set a break point on my
> > function, it says 'Function "blah" not defined' and when it segments somewhere
> > under SPI_execp called from my function the stack trace has all the postgres
> > symbols but just a '??' at the place my function is obviously sitting.
>
> Use the command LOAD to load the dynamic object into the server process,
> then set the break point, then run the function.

Thanks Peter and Tom. I haven't actually checked that a segmentation fault
lists my function in the stack trace properly (I fixed that fault by code
inspection) however, I had discovered that once the function had run without
faulting the symbols were there. There's too many variables to check properly
now but I had tried using LOAD before and it made no difference but then I
might not have tried the LOAD then attach gdb sequence.

The principal mistake I think was my forgetting that the load isn't done until
the function is first used.


--
Nigel J. Andrews


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: debugging C functions
Next
From: "Johnson, Shaunn"
Date:
Subject: Re: splitting a table?