Mismatch Debug Configuration->Source Lookup Path vs. Project->Source Location? [message #229611] |
Wed, 28 January 2009 06:17  |
Eclipse User |
|
|
|
Hi,
I have a Makefile C++ project (named myproject) where my working directory
is not the root of the project, say
${workspace_loc:/myproject/examples/ex_current} (as appears in Project ->
Properties -> C/C++ Build -> Builder Settings (tab) -> Build directory).
Currently, this directory contains some of the sources, the executable,
and my input/output files for execution.
I have another directory /myproject/examples/ex_base/ex_base1 (the first
"/" not meaning the root of the filesystem, but being in the project
directory) with all the same files. It is a base version that I have
replicated for testing purposes, so ex_current has slightly modified files.
The problem is that when I debug my executable, sometimes the debugger
shows me sources in /myproject/examples/ex_base/ex_base1 instead of
/myproject/examples/ex_current. I do not find where to let Eclipse know
which are the right sources. I could remove ex_base/ex_base1, or move it
somewhere else, but I would like to know how to control Eclipse more
precisely. The things that I have done after duplicating the directory
from ex_base/ex_base1 to ex_current, that I thought could solve my problem
(and did not) are:
1- Remove all *.d dependency files and recompile the whole project, to
make sure there were no object files pointing to base sources. I did this
from outside Eclipse, at a Cygwin bash command line.
2- For the project, in Properties -> C/C++ General -> Paths and Symbols ->
Source Location (tab), under the folder myproject, I have added the
folders /ex_base and /ex_base/ex_base1 to the filter.
3- Project -> Index -> Rebuild
4- Project -> Index -> Freshen all files
5- Project -> Refresh
After doing all this, my Debug Configurations -> Source (tab) still showed
the filtered directories of point 2 in the Source Lookup Path, under
Default -> myproject. There were actually other directories that I had
also filtered. There seems to be a disconnect between the directories that
show up in the Source Lookup Path for a Debug Configuration and the Source
Location for a Project.
I will describe a little bit more my project, which may help finding the
causes for the problem. I have a main file main.c, some C sources and some
C++ sources. Another symptom of the duplicity is the following. While I am
debugging, say, a function F1 in main.c, and I enter from there a function
F2 in source src1.c, Eclipse goes to ex_base/ex_base1/src1.c instead of
ex_current/src1.c. The stack in the Debug tab consistently (and
erroneously) shows ex_base/ex_base1/src1.c. On the other hand, if I hover
over the call to F2 in main.c, and Control-Click on F2, it correctly goes
to ex_current/src1.c. All this is for a src1.c which is exactly the same
in both directories. Now for another src2.cc which was slightly changed,
when entering F3 in src2.cc, the debugger goes to the wrong
ex_base/ex_base1/src2.cc, but it shows the correct entry line number, both
in the editor window and the debug stack, so the whole debugging becomes
messy.
Any hint on this?
|
|
|
|
Powered by
FUDForum. Page generated in 0.07614 seconds