Re: Question about debugger

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Question about debugger
Дата
Msg-id 1066367017.582.13.camel@tokyo
обсуждение исходный текст
Ответ на Question about debugger  (kkim3@ncsu.edu)
Список pgsql-hackers
On Wed, 2003-10-15 at 11:43, kkim3@ncsu.edu wrote:
> Hello,
> 
> I'm a student who use postgresql. I'd like to debug postgres source code.I
> tried to use "ddd" in linux. The thing what I want to do is debugging
> backend part.How can I do that. The commands that I used until now are
> following.
> 
> 1. ddd postgres
> 2. In the ddd,I tried to attach pid. (but I can't find pid about backend)
> 3. When I tried to run program with break point,I met error like "can't
> find 2003-10-15(that is the date and time when I run)".
> 
> So,I'm not sure how can I use "ddd". Could let me know how can I use this?

If you'd like info on using ddd, read the ddd docs or ask on their
mailing list -- there shouldn't be anything particularly unique about
using ddd on PostgreSQL rather than any other program that uses fork().

In any case, it's pretty straightforward to use gdb. I do the following:

1. build PostgreSQL with --enable-debug. Also, debugging is less painful
if you use CFLAGS='-O0'.

2. start up PostgreSQL and connect to it

3. find the PID of the postgres backend using ps or some equivalent

4. run 'gdb -p xxx', where xxx is the PID of the postgres backend
process -- then set breakpoints, and all that jazz.

-Neil




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Some more information_schema issues
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Still a few flaws in configure's default CFLAGS selection