Thread: RE: [HACKERS] How do I get the backend server into gdb?

RE: [HACKERS] How do I get the backend server into gdb?

From
Michael J Davis
Date:
I tired but it breaks in the Postmaster and not in the backend process that
is created for each process.
-----Original Message-----From:    Theo Kramer [SMTP:theo@flame.co.za]Sent:    Wednesday, April 28, 1999 2:08 PMTo:
pgsql-hackers@postgreSQL.orgSubject:   Re: [HACKERS]  How do I get the backend server into
 
gdb?
Bruce Momjian wrote:> > There is some option that starts backends, and then sleeps > waiting for a> gdb connection, or
somethinglike that.> 
 
Why not just the following
gdb postmaster
Set one ore more breakpoints where you think the problem might be, then type 'run'.
Start the client and with a bit of luck gdb will break atthe breakpoint set.
You may need to do this a couple of times until youhave found the right area in the code.--------RegardsTheo


RE: [HACKERS] How do I get the backend server into gdb?

From
Vince Vielhaber
Date:
On 28-Apr-99 Michael J Davis wrote:
> I tired but it breaks in the Postmaster and not in the backend process that
> is created for each process.

Have you tried starting the postmaster in debug mode?   From man postmaster:
      -d [debug_level]           The  optional  argument  debug_level  determines  the           amount of debugging
outputthe backend  servers  will           produce.   If debug_level is one, the postmaster will           trace all
connectiontraffic, and nothing else.   For           levels  two and higher, debugging is turned on in the
backendprocess  and  the  postmaster  displays  more           information,  including  the  backend environment and
      process traffic.  Note that if no file  is  specified           for  backend  servers  to send their debugging
output          then this output will appear on the  controlling  tty           of their parent postmaster.
 

There other debugging comments in this man page so you may wanna look
at it first.

Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH   email: vev@michvhf.com   flame-mail: /dev/null      # include <std/disclaimers.h>
       TEAM-OS2       Online Campground Directory    http://www.camping-usa.com      Online Giftshop Superstore
http://www.cloudninegifts.com
==========================================================================




Re: [HACKERS] How do I get the backend server into gdb?

From
Bruce Momjian
Date:
See tcop/postgres.c.


> I tired but it breaks in the Postmaster and not in the backend process that
> is created for each process.
> 
>     -----Original Message-----
>     From:    Theo Kramer [SMTP:theo@flame.co.za]
>     Sent:    Wednesday, April 28, 1999 2:08 PM
>     To:    pgsql-hackers@postgreSQL.org
>     Subject:    Re: [HACKERS]  How do I get the backend server into
> gdb?
> 
>     Bruce Momjian wrote:
>     > 
>     > There is some option that starts backends, and then sleeps 
>     > waiting for a
>     > gdb connection, or something like that.
>     > 
> 
>     Why not just the following
> 
>     gdb postmaster
> 
>     Set one ore more breakpoints where you think the problem 
>     might be, then type 'run'.
> 
>     Start the client and with a bit of luck gdb will break at
>     the breakpoint set.
> 
>     You may need to do this a couple of times until you
>     have found the right area in the code.
>     --------
>     Regards
>     Theo
> 
> 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026