Skip site navigation (1) Skip section navigation (2)

Debugging PostgreSQL with GDB

From: "Manolo SupaMA" <manolo(dot)espa(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Debugging PostgreSQL with GDB
Date: 2008-04-01 15:35:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

I have problems on how to debug PostgreSQL on Linux using GDB. I made some
changes to src/backend/utils/sort/tuplesort.c but it hangs while performing
run formation (where my changes are).

I configured it using

./configure --prefix="/usr/local/pgsql/8.3/" CFLAGS="-O0 -DTRACE_SORT"
--enable-debug --enable-cassert --enable-depend

and trying to debug it using

'gdb postmaster'
(which revealed to be not a very good idea) and
'gdb pg_ctl' followed by 'run -D /usr/local/psql/data'

This last choice allowed me to set a breackpoint on puttuple_common
(contained into tuplesort.c) but then I'm unable to run 'psql'.

I'm new on GDB and it's also my first postgrest patch. I just want some
suggestion to know if I'm on the right way or not.

Thanks for your time.

PS: I suppose I'll write some related  "HowTo Debug PostgreSQL with GDB -
Basics" for newbies like me.


pgsql-hackers by date

Next:From: korryDate: 2008-04-01 15:42:00
Subject: Re: Debugging PostgreSQL with GDB
Previous:From: tomasDate: 2008-04-01 15:34:33
Subject: Re: [HACKERS] Avahi support for Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group