Open unmatch source file when step into parse_analyze() in Eclipse?

Started by homalmost 15 years ago7 messages
#1hom
obsidianhom@gmail.com

Hi,

I'm debug Postgresql with Eclipse under Redhat and I met a problem.

when I step in then function parse_analyze(), Eclipse opened file
src/backend/commands/analyze.c.
But actually, function parse_analyze() should match the file
src/backend/parser/analyze.c.

So I found the execute order didn't match the source code.

How can I make the Eclipse open the right file?

Thank you for answering

PS: I have set compile optimization level to 0 with CFLAGS='-O0' and
it worked well in other source code.

--
Best Wishes!

                                     hom

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: hom (#1)
Re: Open unmatch source file when step into parse_analyze() in Eclipse?

On 03.03.2011 16:46, hom wrote:

Hi,

I'm debug Postgresql with Eclipse under Redhat and I met a problem.

when I step in then function parse_analyze(), Eclipse opened file
src/backend/commands/analyze.c.
But actually, function parse_analyze() should match the file
src/backend/parser/analyze.c.

So I found the execute order didn't match the source code.

How can I make the Eclipse open the right file?

Hmm, seems like a bug in Eclipse debugger. I found this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=35960

In the next-to-last comment, Mikhail Khodjaiants suggests checking the
"Search for duplicate source files" option in the launch configuration.

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

#3hom
obsidianhom@gmail.com
In reply to: Heikki Linnakangas (#2)
Re: Open unmatch source file when step into parse_analyze() in Eclipse?

Thanks Heikki Linnakangas :)

"Search for duplicate source files" option works fine in my eclipse,
but in my friend's eclipse, it still finds wrong source file.

And there is another problem:

when I debug step in the scanner_init(), Eclipse always finds scan.l
and the excute order is still unmatched.
May it be scan.c actually ?

PS: I have turn "Search for duplicate source files" option on.

2011/3/4 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>:

On 03.03.2011 16:46, hom wrote:

Hi,

  I'm debug Postgresql with Eclipse under Redhat and I met a problem.

when I step in then function parse_analyze(), Eclipse opened file
src/backend/commands/analyze.c.
But actually, function parse_analyze() should match the file
src/backend/parser/analyze.c.

So I found the execute order didn't match the source code.

How can I make the Eclipse open the right file?

Hmm, seems like a bug in Eclipse debugger. I found this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=35960

In the next-to-last comment, Mikhail Khodjaiants suggests checking the
"Search for duplicate source files" option in the launch configuration.

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

--
Best Wishes!

                                     hom

#4Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: hom (#3)
Re: Open unmatch source file when step into parse_analyze() in Eclipse?

On 04.03.2011 14:55, hom wrote:

when I debug step in the scanner_init(), Eclipse always finds scan.l
and the excute order is still unmatched.
May it be scan.c actually ?

Well, scan.c is generated with flex from scan.l. I don't know if Eclipse
can handle that correctly.

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

#5hom
obsidianhom@gmail.com
In reply to: Heikki Linnakangas (#4)
Re: Open unmatch source file when step into parse_analyze() in Eclipse?

I think Eclipse just find incorrect file.
when Eclipse compiles the code, it should use scan.c to build.
But when debugging, Eclipse open scan.l to step in.

I don't known how to trace into scan.c :(

2011/3/4 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>:

On 04.03.2011 14:55, hom wrote:

when I debug step in the scanner_init(),  Eclipse always finds scan.l
and the excute order is still unmatched.
May it be scan.c actually ?

Well, scan.c is generated with flex from scan.l. I don't know if Eclipse can
handle that correctly.

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

--
Best Wishes!

                                     hom

#6Robert Haas
robertmhaas@gmail.com
In reply to: hom (#5)
Re: Open unmatch source file when step into parse_analyze() in Eclipse?

On Fri, Mar 4, 2011 at 11:40 AM, hom <obsidianhom@gmail.com> wrote:

I think Eclipse just find incorrect file.
when Eclipse compiles the code, it should use scan.c to build.
But when debugging, Eclipse open scan.l to step in.

That's a feature, not a bug.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#7hom
obsidianhom@gmail.com
In reply to: Robert Haas (#6)
Re: Open unmatch source file when step into parse_analyze() in Eclipse?

but if Eclipse steps in scan.I, the excute order does not match the source code.

what should I do if I want to debug functions defined in scan.I ?

2011/3/5 Robert Haas <robertmhaas@gmail.com>:

On Fri, Mar 4, 2011 at 11:40 AM, hom <obsidianhom@gmail.com> wrote:

I think Eclipse just find incorrect file.
when Eclipse compiles the code, it should use scan.c to build.
But when debugging, Eclipse open scan.l to step in.

That's a feature, not a bug.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Best Wishes!

                                     hom