Author Topic: How to use Cscope  (Read 12259 times)

Offline mmccarty12

  • Multiple posting newcomer
  • *
  • Posts: 28
How to use Cscope
« on: July 20, 2010, 05:41:15 pm »
I think it is great that individuals are creating more and more add-ons to use with Code::Blocks.  I have been using Code::Blocks for 3 years now.  One thing I have noticed is that instructions/descriptions of the add-ons has been very lacking and it is getting frustrating.

I have checked up on Cscope and the other add-ons and can find documentation on how to use them either from the command line or from their given GUIs.  But, what I cannot find it how to use them in Code::Blocks. 
I have found that when you highlight a variable/function name and right click, more menu options come up.  But when I select either Find functions called by <name> or Find functions calling <name>, I get nothing in the Cscope panel. 
Where is the command that sets up the initial database for C::B::Cscope to work properly?  I have been through every menu and right click option I can find.

Can someone clear this up for all of us not in the know?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to use Cscope
« Reply #1 on: July 20, 2010, 07:30:05 pm »
Do you have cscope installed ?
The plugin only makes use of the executable.

On linux you can use your favourite package manager to install it, on windows you should use a search-engine to find it's home page.

Offline mmccarty12

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: How to use Cscope
« Reply #2 on: July 20, 2010, 07:32:39 pm »
jens,

I do have Cscope installed in Code::Blocks.  The instructions on the internet I have found for Cscope discuss how to use it from the command line, not how to use it in C::B.  I would like to know how to use it from the C::B interface.  Are there instructions on how to do that?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to use Cscope
« Reply #3 on: July 20, 2010, 07:36:03 pm »
I know that you have installed it in C::B, otherwise you would not be able to see the new menu-entries.
But what I want to know, whether you have installed the cscope-executable, that was build for your OS, and if yes is it in system-searchpath ?

The plugin just calls the exe and parses the output.

Offline mmccarty12

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: How to use Cscope
« Reply #4 on: July 20, 2010, 10:29:07 pm »
jens,

Thank you for the information.  That is the information I needed, that you had to have cscope installed to utilize the plugin.  Once that was done, then everything appears to work correctly.  But, that goes back to my original statement about the lack of instructions on how to use some of the plugins.

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: How to use Cscope
« Reply #5 on: December 10, 2010, 02:05:00 am »
Like mmccarty12, I'm trying to figure how to use cscope. I've already downloaded the win32 binary for it. Do I need to point the cscope plugin to where the executable is located? If so, how can I do this?

I'm using C::B svn 6863

Thanks

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: How to use Cscope
« Reply #6 on: December 10, 2010, 09:36:39 am »
@Greatwolf:
Quote
...is it in system-searchpath ?

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: How to use Cscope
« Reply #7 on: December 15, 2010, 02:06:30 pm »
actually I just moved the cscope executable into C::B's directory. Looks like it does work unfortunately cscope doesn't work that well with C++. Too many things it can't recognize.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How to use Cscope
« Reply #8 on: December 15, 2010, 02:30:26 pm »
actually I just moved the cscope executable into C::B's directory. Looks like it does work unfortunately cscope doesn't work that well with C++. Too many things it can't recognize.
if you look at the source code of cscope, you will understand the reason...
it use a lex grammar to do the parsing...
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.