"Jonathan Scher" <[EMAIL PROTECTED]> writes:

> I attach gdb to /usr/.../bin/postgres, then I put a breakpoint. Whenever
> postgres stop on that breakpoint, it just kills/restarts the server instead of
> asking me what to do.

Not sure why it's crashing but you don't want to run postgres itself under the
debugger, at least not usually. What you have to do is start postgres up
normally, connect to it with psql or whatever client you want, then in a
separate shell run something like:

(gdb) shell ps auxww | grep [i]dle
stark     3724  0.0  0.1  36180  2044 ?        Ts   18:07   0:00 postgres: 
stark postgres [local] idle       
(gdb) attach 3724
Attaching to process 3724
Reading symbols from /usr/local/pgsql/bin/postgres...done.

> Reading symbols from /usr/local/pgsql/bin/postgres...(no debugging symbols
> found)...done.

Also, you'll want to configure with --enable-debug or else your gdb session
isn't going to be very enlightening.

Personally I suggest:

CFLAGS='-O0 -g' ./configure --enable-debug --enable-depend --enable-cassert

  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to