Debugger

Started by Pedro Belminoabout 18 years ago7 messages
#1Pedro Belmino
pedrobelmino@gmail.com

Hellow,
I continue to have problems using the debugger, can not achieve any
breakpoint that is outside the postmaster.c? Can anyone give me any hint?
Where do I mark a breakpoint so that I can follow the creation of an index
to file index.c for example?
Thank,

--
Pedro Belmino.
--------------------------------------------------------------------
# Ciência da Computação - UNIFOR
# pedrobelmino@gmail.com
--------------------------------------------------------------------

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pedro Belmino (#1)
Re: Debugger

"Pedro Belmino" <pedrobelmino@gmail.com> writes:

I continue to have problems using the debugger, can not achieve any
breakpoint that is outside the postmaster.c? Can anyone give me any hint?
Where do I mark a breakpoint so that I can follow the creation of an index
to file index.c for example?

Sounds to me like you attached the debugger to the wrong process.
Start a session, find out the backend's PID, then attach to that.

regards, tom lane

#3Alexey Klyukin
alexk@commandprompt.com
In reply to: Pedro Belmino (#1)
Re: Debugger

PostgreSQL consists of multiple processes, launched by postmaster, make
sure you are debugging the right one. After connecting to a database
with your favorite client (i.e. psql) you can use ps (if you have a
unix-like system) or a task manager to determine a pid of postgres
process and then attach to that process with a debugger.

Pedro Belmino wrote:

Hellow,
I continue to have problems using the debugger, can not achieve any
breakpoint that is outside the postmaster.c? Can anyone give me any hint?
Where do I mark a breakpoint so that I can follow the creation of an index
to file index.c for example?
Thank,

--
Pedro Belmino.
--------------------------------------------------------------------
# Ci�ncia da Computa��o - UNIFOR
# pedrobelmino@gmail.com
--------------------------------------------------------------------

--
Alexey Klyukin http://www.commandprompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#4Gregory Stark
stark@enterprisedb.com
In reply to: Pedro Belmino (#1)
Re: Debugger

"Pedro Belmino" <pedrobelmino@gmail.com> writes:

Hellow,
I continue to have problems using the debugger, can not achieve any
breakpoint that is outside the postmaster.c? Can anyone give me any hint?
Where do I mark a breakpoint so that I can follow the creation of an index
to file index.c for example?

You have to start up your psql or other client run "SELECT pg_backend_pid();"
and attach to that process in the debugger. It sounds like you've connected to
the postmaster which doesn't actually do any of the work, it just forks other
backends.

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

#5Pedro Belmino
pedrobelmino@gmail.com
In reply to: Gregory Stark (#4)
Re: Debugger

I am using linux.
1. Inicializei the postgres the console by running. / Postgres.
2. Joined in psql through console and simulated. / Psql
3. Pg_backend_pid swirled SELECT () to get the id of the process;
4. In ide tried to use that process to attach the debugger but gives the
following error message:
Unable to open file socket: target process not responding HotSpot VM or not
loaded

Thank,
2007/10/19, Gregory Stark <stark@enterprisedb.com>:

"Pedro Belmino" <pedrobelmino@gmail.com> writes:

Hellow,
I continue to have problems using the debugger, can not achieve any
breakpoint that is outside the postmaster.c? Can anyone give me any

hint?

Where do I mark a breakpoint so that I can follow the creation of an

index

to file index.c for example?

You have to start up your psql or other client run "SELECT
pg_backend_pid();"
and attach to that process in the debugger. It sounds like you've
connected to
the postmaster which doesn't actually do any of the work, it just forks
other
backends.

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

--
Pedro Belmino.
--------------------------------------------------------------------
# Ciência da Computação - UNIFOR
# pedrobelmino@gmail.com
--------------------------------------------------------------------

#6Pedro Belmino
pedrobelmino@gmail.com
In reply to: Pedro Belmino (#5)
Re: Debugger

Excuse me,
My previous email, I had a problem formatting of my text. So it is not
understandable.
Correcting:
Pinged the following steps in the console:
1. Pinged the command postgres to start.
2. Joined in psql.
3. Typed the following command to get the id of the process:
"SELECT pg_backend_pid();"
4. Tried to attach the id of the process to the debugger and gave the error:
"Unable to open socket file: target process not responding or HotSpot VM not
loaded"

2007/10/19, Pedro Belmino <pedrobelmino@gmail.com>:

I am using linux.
1. Inicializei the postgres the console by running. / Postgres.
2. Joined in psql through console and simulated. / Psql
3. Pg_backend_pid swirled SELECT () to get the id of the process;
4. In ide tried to use that process to attach the debugger but gives the
following error message:
Unable to open file socket: target process not responding HotSpot VM or
not loaded

Thank,
2007/10/19, Gregory Stark <stark@enterprisedb.com>:

"Pedro Belmino" <pedrobelmino@gmail.com> writes:

Hellow,
I continue to have problems using the debugger, can not achieve any
breakpoint that is outside the postmaster.c? Can anyone give me any

hint?

Where do I mark a breakpoint so that I can follow the creation of an

index

to file index.c for example?

You have to start up your psql or other client run "SELECT
pg_backend_pid();"
and attach to that process in the debugger. It sounds like you've
connected to
the postmaster which doesn't actually do any of the work, it just forks
other
backends.

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

--
Pedro Belmino.
--------------------------------------------------------------------
# Ciência da Computação - UNIFOR
# pedrobelmino@gmail.com
--------------------------------------------------------------------

--
Pedro Belmino.
--------------------------------------------------------------------
# Ciência da Computação - UNIFOR
# pedrobelmino@gmail.com
--------------------------------------------------------------------

#7Heikki Linnakangas
heikki@enterprisedb.com
In reply to: Pedro Belmino (#6)
Re: Debugger

Pedro Belmino wrote:

4. Tried to attach the id of the process to the debugger and gave the error:
"Unable to open socket file: target process not responding or HotSpot VM not
loaded"

You're trying to use a Java debugger to attach to a non-Java program
(Postgres). That's not going to work. Use a tool like gdb or ddd instead.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com