Re: I am confused after reading codes of PostgreSQL three week

From: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
To: hom <obsidianhom(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: I am confused after reading codes of PostgreSQL three week
Date: 2011-03-20 10:11:09
Message-ID: AANLkTinWbO2MP0wN5TcBfAoOGJxRsbQk2zue7KCOkunR@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/3/20 hom <obsidianhom(at)gmail(dot)com>:

> I trace into scan.c because I want to known how the paser tree is
> built and I debug the source step by step.

I suggest you learn how flex/bison work first. The contents of the *.c
files generated by flex/bison are not generally supposed to be
interpreted by humans, rather you should read their original sources
(*.l and *.y).

> Then the eclipse pick up the scan.I and the excute order does not
> match the code.

Eclipse seems to understand that any code corresponding to the
generated .c file actually originates in the .l file, but apparently
fails to match (some of?) the line numbers. OTOH, I cannot really
imagine how it is supposed to match them as long as you are not
executing lines that are literally copied from the .l file (e.g., as
long as the lexer or parser code itself is being executed), so that
may be normal.

Again: Do not try to read the generated .c files, but rather read the
corresponding .l and .y files. The tarballs may include those
generated .c files, but as you will find out when checking out the
repository itself, they are not really considered "source" (i.e., they
are not included). When debugging, skip over the lexer and parser code
itself, just put your breakpoints in the C code in the .l and .y files
(I hope Eclipse might match *those* line numbers a least, and make the
breakpoints work).

Nicolas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-03-20 11:58:32 Re: VACUUM FULL deadlock with backend startup
Previous Message Martijn van Oosterhout 2011-03-20 10:08:43 Re: I am confused after reading codes of PostgreSQL three week