Re: debugging C functions

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: debugging C functions
Date: 2003-06-20 18:15:02
Message-ID: Pine.LNX.4.21.0306201909330.29248-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2003-06-20 18:22:24 Re: splitting a table?
Previous Message Peter Eisentraut 2003-06-20 18:00:35 Re: debugging C functions