News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

find implementation

Started by killerbot, February 16, 2012, 11:44:56 AM

Previous topic - Next topic

killerbot

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

ollydbg

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.

Alpha

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.

ollydbg

Quote from: Alpha 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.
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.

killerbot

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 ?

ollydbg

Quote from: killerbot 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.
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.