Re: Noob Hints on testing and debugging? - Mailing list pgsql-hackers

From Dave Page
Subject Re: Noob Hints on testing and debugging?
Date
Msg-id 937d27e10803120147h24662898tbd6dfa451cd5bf73@mail.gmail.com
Whole thread Raw
In response to Noob Hints on testing and debugging?  (James Mansion <james@mansionfamily.plus.com>)
List pgsql-hackers
On Wed, Mar 12, 2008 at 7:21 AM, James Mansion
<james@mansionfamily.plus.com> wrote:
> Are there any hints and tips anywhere on practical issues for testing
>  and debugging changes to a backend?
>
>  (eg how to run it up and feed it SQL ideally without running a
>  postmaster and execing a back end)
>
>  I'm using VS2008 on XP by choice, and I'd like to investigate supporting
>  something closely related to
>  the Firebird 2.1 trigger on transaction commmit and rollback.

I've yet to try 2008, but 2005 works beautifully when debugging the
server - even stepping into non-core code is simple (I spent some time
in the plpgsql debugger plugin for example).

The hard part can be attaching the debugger to the appropriate
backend. You can either introduce a startup delay (there's a backend
command line option for that iirc), or if you want to break at a
specific point, I sometimes add a loop to the code along the lines of:

int x=0;
while (!x)   Sleep(100);

When the backend hits that point, attach the debugger, break
execution, and set x to a value in the locals window. Then you can
step through the code from that point.

-- 
Dave Page
EnterpriseDB UK Ltd: http://www.enterprisedb.com
PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk


pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add: > o Add SQLSTATE severit yto PGconn return status > >
Next
From: Greg Smith
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add: > o Add SQLSTATE severity to PGconn return status > >