Thread: Debug user lib for user define data type

Debug user lib for user define data type

From
"Ale Raza"
Date:
Hi,
 
I am writing a user defined data type in C and want to debug the lib I am creating for this data type. Wondering if somebody knows how to link and debug this lib or any document which can help me to do this? Can I debug this lib without compiling the PostgreSQL source code?
 
I use prebuilt RPM package to installed PostgreSQL(7.4.6).
Platform: Red Hat Enterprise Linux AS release 3 (Taroon). Kernel 2.4.21-4.EL on an i686
 
Thanks.
 
Ale Raza
 
 

Re: Debug user lib for user define data type

From
Martijn van Oosterhout
Date:
On Wed, Dec 14, 2005 at 11:52:19AM -0800, Ale Raza wrote:
> Hi,
>
> I am writing a user defined data type in C and want to debug the lib
> I am creating for this data type. Wondering if somebody knows how to
> link and debug this lib or any document which can help me to do this?
> Can I debug this lib without compiling the PostgreSQL source code?
>
> I use prebuilt RPM package to installed PostgreSQL(7.4.6).
> Platform: Red Hat Enterprise Linux AS release 3 (Taroon). Kernel 2.4.21-4.EL on an i686

Hmm, you need the source code you make your user-defined type, and to
have it work you need to compile with exactly the same options. The
easiest way to do that is to compile both the server and your lib
yourself.

That said, it can be done, you just use GDB to attach to the backend
and break on your functions. But GBD will probably irritate you unless
you compile the server for debugging also.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

Re: Debug user lib for user define data type

From
"Ale Raza"
Date:
OK, thanks meneer!

Ale

-----Original Message-----
From: Martijn van Oosterhout [mailto:kleptog@svana.org]
Sent: Thursday, December 15, 2005 11:35 AM
To: Ale Raza
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Debug user lib for user define data type


On Wed, Dec 14, 2005 at 11:52:19AM -0800, Ale Raza wrote:
> Hi,
>
> I am writing a user defined data type in C and want to debug the lib
> I am creating for this data type. Wondering if somebody knows how to
> link and debug this lib or any document which can help me to do this?
> Can I debug this lib without compiling the PostgreSQL source code?
>
> I use prebuilt RPM package to installed PostgreSQL(7.4.6).
> Platform: Red Hat Enterprise Linux AS release 3 (Taroon). Kernel 2.4.21-4.EL on an i686

Hmm, you need the source code you make your user-defined type, and to
have it work you need to compile with exactly the same options. The
easiest way to do that is to compile both the server and your lib
yourself.

That said, it can be done, you just use GDB to attach to the backend
and break on your functions. But GBD will probably irritate you unless
you compile the server for debugging also.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.