> 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'.
Run psql, find the process ID of the backend (server) process by
executing the command "SELECT * FROM pg_backend_pid();",
then attach to that process with gdb and set a breakpoint in your new
code; finally, go back to your psql session and execute a command that
exercises your code.
Korry Douglas <korryd(at)enterprisedb(dot)com>
In response to
pgsql-hackers by date
|Next:||From: Andrew Dunstan||Date: 2008-04-01 15:43:24|
|Subject: Re: Debugging PostgreSQL with GDB|
|Previous:||From: Manolo SupaMA||Date: 2008-04-01 15:35:53|
|Subject: Debugging PostgreSQL with GDB|