Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Call references(Is it possible to find out where the methods, class variables, etc., are called)
Call references [message #1272326] Mon, 17 March 2014 16:45 Go to next message
Marko Gašparič is currently offline Marko GašparičFriend
Messages: 10
Registered: May 2013
Location: Free University of Bolzan...
Junior Member
Maybe it is a stupid question, but I am looking for an answer for quite a while without any results.
Is it possible to find out reference calls with CDT?

Here is a simple example:

#include <iostream>
using namespace std;

int addition (int a, int b)
{
int r;
r=a+b;
return (r);
}

int main ()
{
int z;
z = addition (5,3);
cout << "The result is " << z;
return 0;
}


Can I somehow get out from AST that main makes a call to this specific addition (int a, int b), or that addition (int a, int b) is called in the main()?
Does something similar exist for class variables and other references?

I hope someone can answer!

Regards,
Re: Call references [message #1272826 is a reply to message #1272326] Tue, 18 March 2014 21:40 Go to previous messageGo to next message
Yevgeny Shifrin is currently offline Yevgeny ShifrinFriend
Messages: 208
Registered: July 2009
Senior Member
Are you asking a question as CDT user or developer?

As CDT user just select variable or function right click call hierarchy.
Re: Call references [message #1272957 is a reply to message #1272826] Wed, 19 March 2014 07:01 Go to previous messageGo to next message
Marko Gašparič is currently offline Marko GašparičFriend
Messages: 10
Registered: May 2013
Location: Free University of Bolzan...
Junior Member
I am asking as a developer. I am using CDT to construct AST from a source code and I need to find a way to discover also the relations between the parts of source code, so I can calculate a cyclomatic complexity, for example.

The optimal answer would be a set of CDT API methods, but the documentation is not comprehensive enough, for me to be able to find the answer. I also searched forums, but didn't find anything.
Re: Call references [message #1274251 is a reply to message #1272957] Fri, 21 March 2014 07:32 Go to previous message
Yevgeny Shifrin is currently offline Yevgeny ShifrinFriend
Messages: 208
Registered: July 2009
Senior Member
I think you should ask this question in cdt-dev mailing list.
Maybe you can look at call hiearchy implementation as a reference.
Previous Topic:qbang RXTX inoperative
Next Topic:custom toolchain
Goto Forum:
  


Current Time: Thu Sep 26 03:14:18 GMT 2024

Powered by FUDForum. Page generated in 0.03761 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top