I am using Eclipse CDT to debug a C++ project in Ubuntu. The GUI, i.e the small arrow showing the next line of source code to be executed, is not aligned with the actual execution. Specifically, it is about 30 lines below the actual executing line. I'm identifying what the actual line is by examining values of local variables and when they change.
I have tried cleaning the pro开发者_高级运维ject several times, including manually deleting all compiled object-codes, libraries etc., in hope that it will cause Eclipse to update itself, but it insists on showing the wrong line.
Any help is appreciated.
It seems pretty likely that the source that Eclipse is showing, and the source that was actually used to compile the executable are different versions of the same file.
You can ask GDB (Eclipse has a console window for GDB) what source was actually used to build the executable, and where GDB found the source it is showing (to Eclipse) with info source
GDB command. I bet the Compilation directory + Current source file != Located in
.
Check your executable is up to date. For some reason the makefile eclipse generates doesn't include dependencies on static libraries. If you are using static libraries as part of your project, you may need to rebuild them manually.
精彩评论