Author Topic: find implementation  (Read 7599 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5258
find implementation
« on: February 16, 2012, 11:44:56 am »
Something that happens to me a lot :

- workspace with several projects (which build static libs) and 1 project which builds the executable app.
- the app project is active
- some cpp file from a lib is open, and I am in a class method implemented in that cpp file, which calls another method from the same class
a) find declaration --> no problem
b) find implementation --> NOT found !!!!!!!!!
  - thought the implementation is even in the same file

And sometimes later on it works (very often after doing a find declaration first)

Have no found a way to reproduce this reliably

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5280
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: find implementation
« Reply #1 on: February 16, 2012, 01:31:33 pm »
See this: 8.4 Debug Smart Sense log output, and post the log when you have such problem. The log can help us to identify which part of CC goes wrong.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: find implementation
« Reply #2 on: February 17, 2012, 03:49:15 am »
I have experienced similar problems while working on a plugin; I think it is related to what huzhongshan reported about Code::Blocks failing to update the common top level path when switching projects.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5280
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: find implementation
« Reply #3 on: February 17, 2012, 03:52:07 am »
I have experienced similar problems while working on a plugin; I think it is related to what huzhongshan reported about Code::Blocks failing to update the common top level path when switching projects.
Not sure, but the smart sense log can give many details.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5258
Re: find implementation
« Reply #4 on: February 20, 2012, 08:54:08 am »
it just happened to me again.

Workspace , with several projects :
2 sources files (foo.cpp/foo.h) were open which did not belong to the active project.
In the foo.cpp I was using a variable declaration, it's type was a struct declared in the the header foo.h. Find declaration --> nothing happened.
Actiavted the project that contained the 2 source files : Find declaration --> nothing happened.

Switched from project browser to symbol browser. Navigated into the namespace of Foo (ef FooNs), expanded that, and the struct type was in there. Clicked on it --> information in the bottom panel.

Then went back to foo.cpp and tried find declaration --> works NOW.

So didn't get a chance to do the debug trick.


Refresh problem as suggested above ?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5280
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: find implementation
« Reply #5 on: February 23, 2012, 01:39:34 am »
it just happened to me again.

Workspace , with several projects :
2 sources files (foo.cpp/foo.h) were open which did not belong to the active project.
In the foo.cpp I was using a variable declaration, it's type was a struct declared in the the header foo.h. Find declaration --> nothing happened.
Actiavted the project that contained the 2 source files : Find declaration --> nothing happened.

Switched from project browser to symbol browser. Navigated into the namespace of Foo (ef FooNs), expanded that, and the struct type was in there. Clicked on it --> information in the bottom panel.

Then went back to foo.cpp and tried find declaration --> works NOW.

So didn't get a chance to do the debug trick.
I do not know why you don't get a chance to do the debug trick. When you initially load the project/workspace, you can enable the smart sense debug log. This will show clear information about the failure.

Quote
Refresh problem as suggested above ?
What does this sentence mean?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.