Author Topic: Cross reference?  (Read 6231 times)

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Cross reference?
« on: December 29, 2011, 12:54:42 pm »
Hi,

I'm new to codeblocks and couldn't find anything about cross reference. Here's what I would like to do:

If I have code that looks like this:

Code: [Select]
void f1()
{
}

void f2()
{
    f1();
}

int main()
{
    f1();
}

I want to be able to view all calls to f1(). Is it possible? Of course, I can just use the search tool, but I prefer to be able to right-click a symbol and find where it is used.

Thanks,
Erez

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Cross reference?
« Reply #1 on: December 29, 2011, 01:20:06 pm »
I want to be able to view all calls to f1().
Yes, if you are using the CScope plugin. As you didn't mention anything about your configuration I cant help more.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Cross reference?
« Reply #2 on: December 29, 2011, 01:34:44 pm »
I'm running v10.05 on ubuntu. How do I install this plugin? Do I need to compile it?

Thanks,
Erez

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12005
    • Travis build status
Re: Cross reference?
« Reply #3 on: December 29, 2011, 01:44:20 pm »
Do you have the contrib plugins installed? You need to install codeblocks-contrib package.

But, I'm not sure if the cscope plugin is available in 10.05.
If it is not available you'll have to use a nightly build from Jens' repo @ apt.jenslody.de
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Cross reference?
« Reply #4 on: December 29, 2011, 01:53:17 pm »
I've just installed codeblocks-contrib. How can I check if cscope is available for v10.05? In general, where can I look for plugins for v10.05?

Thanks,
Erez

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cross reference?
« Reply #5 on: December 29, 2011, 01:57:00 pm »
You also need the cscop package provided by your distro, to make the plugin work.

I've just installed codeblocks-contrib. How can I check if cscope is available for v10.05? In general, where can I look for plugins for v10.05?

"Plugins -> Manage plugins" lists all available plugins and their state.

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Cross reference?
« Reply #6 on: December 29, 2011, 02:36:50 pm »
I installed cscope (supplied by ubuntu), but I don't see it in the list in "Plugins -> Manage plugins". Did I miss anything?

BTW - the ubuntu cscope package contains the following files:

/.
/usr
/usr/bin
/usr/bin/cscope
/usr/bin/ocs
/usr/bin/cscope-indexer
/usr/share
/usr/share/doc
/usr/share/doc/cscope
/usr/share/doc/cscope/contrib
/usr/share/doc/cscope/contrib/README
/usr/share/doc/cscope/contrib/webcscope
/usr/share/doc/cscope/contrib/webcscope/cscope.gz
/usr/share/doc/cscope/contrib/webcscope/icons
/usr/share/doc/cscope/contrib/webcscope/icons/back.gif
/usr/share/doc/cscope/contrib/webcscope/icons/bomb.gif
/usr/share/doc/cscope/contrib/webcscope/icons/c.gif
/usr/share/doc/cscope/contrib/webcscope/icons/down.gif
/usr/share/doc/cscope/contrib/webcscope/icons/folder.gif
/usr/share/doc/cscope/contrib/webcscope/icons/folder.open.gif
/usr/share/doc/cscope/contrib/webcscope/icons/left.gif
/usr/share/doc/cscope/contrib/webcscope/icons/up.gif
/usr/share/doc/cscope/contrib/webcscope/icons/world2.gif
/usr/share/doc/cscope/contrib/webcscope/INSTALL
/usr/share/doc/cscope/contrib/webcscope/TODO
/usr/share/doc/cscope/contrib/webcscope/cgi-lib.pl.gz
/usr/share/doc/cscope/contrib/webcscope/hilite.c.gz
/usr/share/doc/cscope/AUTHORS
/usr/share/doc/cscope/README
/usr/share/doc/cscope/TODO
/usr/share/doc/cscope/copyright
/usr/share/doc/cscope/NEWS.gz
/usr/share/doc/cscope/changelog.Debian.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/cscope.1.gz
/usr/share/man/man1/ocs.1.gz
/usr/share/man/man1/cscope-indexer.1.gz

Thanks,
Erez

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12005
    • Travis build status
Re: Cross reference?
« Reply #7 on: December 29, 2011, 02:45:54 pm »
Then you need a nightly build of codeblocks...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cross reference?
« Reply #8 on: December 29, 2011, 03:38:22 pm »
You can install a nightly-build from my server: http://apt.jenslody.de.
See the note for Ubuntu-users on my server !

EDIT:
You might have to remove all C::B packages before you can update from 10.05 release.
Don't be afraid, all (user-)settings will remain.

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Cross reference?
« Reply #9 on: December 29, 2011, 04:12:14 pm »
I followed your instructions and added to /etc/apt/sources.list the following lines:

Code: [Select]
deb http://apt.jenslody.de/ any main
deb-src http://apt.jenslody.de/ any main
deb http://apt.wxwidgets.org/ lenny-wx main

I got this when trying to install:

Code: [Select]
The following packages have unmet dependencies:
codeblocks: Depends: libcodeblocks0 (= 10.05svn7639-1) but it is not going to be installed
Depends: libwxbase2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu8.1 is to be installed
Depends: libwxgtk2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu8.1 is to be installed
codeblocks-additional: Depends: libcodeblocks0 but it is not going to be installed
Depends: libwxsmithlib0 (= 10.05svn7639-1) but it is not going to be installed
codeblocks-contrib: Depends: libcodeblocks0 but it is not going to be installed
Depends: libwxbase2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu8.1 is to be installed
Depends: libwxgtk2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu8.1 is to be installed
Depends: libwxsmithlib0 (= 10.05svn7639-1) but it is not going to be installed

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cross reference?
« Reply #10 on: December 29, 2011, 10:29:57 pm »
Are the packages from apt.wxwidgtes.org visible in your package-manager ?
If not, did you update the lists after adding apt.wxwidgets.org ?

I just tested it on ubuntu 10.04 (under qemu-kvm) and it works as expected.

Did you import the wxwidgets key as described on my site ?
Normally it should warn about untrusted key, but work anyway,
nevertheless it might be wort a try:

Code: [Select]
wget -q http://apt.wxwidgets.org/key.asc -O-  | sudo apt-key add -

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Cross reference?
« Reply #11 on: January 01, 2012, 08:19:14 am »
Yes, those packages are available in the list, and yes, I did run the "wget -q http://apt.wxwidgets.org/key.asc -O-  | sudo apt-key add -" command.

I manually removed the libwxbase package and then I installed the package from apt.wxwidgets.org (via apt-get). Now, I have v2.8.12.0-0, but it looks like I need v2.8.12.1. Here's the new error message:

Code: [Select]
root@erez-lx:~/t# apt-get install codeblocks
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 codeblocks : Depends: libcodeblocks0 (= 10.05svn7639-1) but it is not going to be installed
              Depends: libwxbase2.8-0 (>= 2.8.12.1) but 2.8.12.0-0 is to be installed
              Depends: libwxgtk2.8-0 (>= 2.8.12.1) but it is not going to be installed
E: Broken packages

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cross reference?
« Reply #12 on: January 01, 2012, 11:00:15 am »
I really don't know what happens there.
I tested it on Ubuntu 11.10 and it works flawlessly.

The lenny-wx repo of apt-wxwidgets.org has 2.8.12.1 in it and if I chose codeblocks and codeblocks-contrib synaptic choses it automagically for me.

Maybe you should try to install it via synaptic (and check whether the appropriate version is available).

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Cross reference?
« Reply #13 on: January 01, 2012, 01:16:53 pm »
I think that I understand the problem: if you look at http://apt.wxwidgets.org/dists/natty-wx/main/binary-i386/, you will not find v2.8.12.1. If you look at http://apt.wxwidgets.org/dists/lenny-wx/main/binary-i386/, you will find it (http://apt.wxwidgets.org/dists/lenny-wx/main/binary-i386/libwxbase2.8-0_2.8.12.1-0_i386.deb).

So, I changed the line in /etc/apt/sources.list from "natty" to "lenny" (although I'm running ubuntu 11.04 Natty Narwhal) and was able to install codeblocks. For some reason, they don't like ubuntu 11.04??

Anyway, thanks a lot for your help.

Erez

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cross reference?
« Reply #14 on: January 01, 2012, 03:07:10 pm »
If you would have read the note for ubuntu users on my page carefully, you would have seen, that I asked you to use the lenny-wx repo for ubuntu.
By the way, the maverick repo contains 2.8.12.1, too, as far as I know.