Bug 61263 - find callers of functions
Summary: find callers of functions
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.0.0
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-15 10:43 UTC by Rüdiger Koch
Modified: 2009-01-31 21:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Koch 2003-07-15 10:43:37 UTC
Version:            (using KDE KDE 3.1KDE 1.2)
Installed from:    SuSE RPMsSuSE RPMs

Sniff allows to find all locations from where a selected function is called. KDevelop already allows to 'grep foo(' in the context menu of the class treeview. While this feature doesn't work for me at all it would not do a good job since:
1. It finds calls of the same function name belonging to a different class
2. It doesn't find calls of functions if there are whitespaces between the function name and the left bracket such as foo->bar ();
3. It doesn't distinguish between overloaded functions
Comment 1 Amilcar do Carmo Lucas 2003-07-15 10:57:47 UTC
It would be nice to know your KDevelop version! 
 
Comment 2 rkoch 2003-07-15 11:47:28 UTC
Subject: Re:  find callers of functions         

version 2.1.3. Sorry if the feature is in a newer version of KDevelop
(3.0) but nothing in the changelog suggests that.

-Rudiger


--- Amilcar do Carmo Lucas <a.lucas@tu-bs.de> wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>      
> http://bugs.kde.org/show_bug.cgi?id=61263     
> a.lucas@tu-bs.de changed:
> 
>            What    |Removed                     |Added
>
----------------------------------------------------------------------------
>           Component|general                     |classview
> 
> 
> 
> ------- Additional Comments From a.lucas@tu-bs.de  2003-07-15 10:57
> -------
> It would be nice to know your KDevelop version!

Comment 3 Amilcar do Carmo Lucas 2003-07-15 12:01:54 UTC
Sorry, KDevelop 2.x is no longer under development.

You are strongly advised to update to the latest CVS version of KDevelop3, code
name gideon, take a look at:
http://www.kdevelop.org/index.html?filename=branches_compiling.html
for all the details you need. If you find a problem or need help please send a
mail to the mailing list:
http://www.kdevelop.org/index.html?filename=mailinglist.html
or drop us a line at the channel #kdevelop on the server irc.kde.org using
ksirc, for example.
Please use the CVS version and compile it yourself because that way you can
easily patch it if a bug is found.

KDevelop3 can open Develop2 projects. To do so, goto the "Project -> Open
Project ... " and select
"KDevelop 2 Project Files" in the "Filter:".
You can have and run KDevelop3 and KDevelop2 at the same time on the same
computer without any problems.
So migrating is a breeze. :)

P.S. : The KDevelop team closed over 452 reported and confirmed bugs since the
release of KDevelop2.1.3
The bad news is that KDevelop3 currently has 120 reported bugs :(
Comment 4 rkoch 2003-07-15 14:18:19 UTC
Subject: Re:  find callers of functions         

Unfortunatelly I am behind a huge firewall. Would you be so kind to
send a tarball to ruediger.koch@db.com ?

Thanks a lot
-Rudiger

--- Amilcar do Carmo Lucas <a.lucas@tu-bs.de> wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>      
> http://bugs.kde.org/show_bug.cgi?id=61263     
> a.lucas@tu-bs.de changed:
> 
>            What    |Removed                     |Added
>
----------------------------------------------------------------------------
>             Version|unspecified                 |2.1.3
> 
> 
> 
> ------- Additional Comments From a.lucas@tu-bs.de  2003-07-15 12:01
> -------
> Sorry, KDevelop 2.x is no longer under development.
> 
> You are strongly advised to update to the latest CVS version of
> KDevelop3, code
> name gideon, take a look at:
> http://www.kdevelop.org/index.html?filename=branches_compiling.html
> for all the details you need. If you find a problem or need help
> please send a
> mail to the mailing list:
> http://www.kdevelop.org/index.html?filename=mailinglist.html
> or drop us a line at the channel #kdevelop on the server irc.kde.org
> using
> ksirc, for example.
> Please use the CVS version and compile it yourself because that way
> you can
> easily patch it if a bug is found.
> 
> KDevelop3 can open Develop2 projects. To do so, goto the "Project ->
> Open
> Project ... " and select
> "KDevelop 2 Project Files" in the "Filter:".
> You can have and run KDevelop3 and KDevelop2 at the same time on the
> same
> computer without any problems.
> So migrating is a breeze. :)
> 
> P.S. : The KDevelop team closed over 452 reported and confirmed bugs
> since the
> release of KDevelop2.1.3
> The bad news is that KDevelop3 currently has 120 reported bugs :(

Comment 5 Amilcar do Carmo Lucas 2003-07-15 17:17:07 UTC
ftp://ftp.kde.org/pub/kde/unstable/snapshots/kdevelop.tar.bz2
Comment 6 rkoch 2003-07-16 10:48:11 UTC
Subject: Re:  find callers of functions         

Let me first say, I am really impressed with gideon. It shows a lot of
potential! Excellent work so far. I am really looking forward to the
stable releases.

The specific feature I was looking for is still not present, although
the grep works, as long as it is looking for pointers as foo->doit();
foo.doit() is not found. My coworkers did not all master regular
expressions. For them, a "find callers" item that simply does what is
requested without intimidating them with a dialog sporting an arcane
regex would be close to ideal. That menu item should be in the class
view - the context menu of a function.

The regex
(\.|\->|::)[\t ]*\<%s\>[\t ]*\(

is getting close. It finds the function definition itself and the "\fn
ClassName::doit(), however - we may filter it out in a second pass.

This would also find Bar::doit() even if Bar has nothing to do with
Foo, but - nobody is perfect.

-Rudiger

--- Amilcar do Carmo Lucas <a.lucas@tu-bs.de> wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>      
> http://bugs.kde.org/show_bug.cgi?id=61263     
> 
> 
> 
> 
> ------- Additional Comments From a.lucas@tu-bs.de  2003-07-15 17:17
> -------
> ftp://ftp.kde.org/pub/kde/unstable/snapshots/kdevelop.tar.bz2

Comment 7 Alexey Arzamasov 2003-09-09 10:01:38 UTC
I guess the feature you are talking about is like a 'Find Usage' feature as it works in 
IntelliJ IDEA (Java IDE), so, this is good. I just want to add here, a some behaviour 
one could add while implelemnting this feature. Along with having a 'Find Usage' 
feature wich produce a list of places in the project like the 'Grep' do, is would be very 
nice to have an 'Hightlight Usage' feature wich is just hightlight the usage of a function 
or a variable in the currect file only and do not produce any windows. Having binded 
this to some shortcut is very handy. Look how it works: 
 - The user presses Alt+Shift+F7 (e.g.) 
 - Gideon hightligh the usage of currenlty selected funciton/variable (or one which is 
under the cursor and not selected) 
 - User got the response, make his/her mind clear about the usage 
 - User press Esc and hightligh turned off. 
Comment 8 Amilcar do Carmo Lucas 2003-09-19 20:36:31 UTC
This is comming. Stay tunned! 
Comment 9 Mike Whittaker 2003-10-02 14:48:47 UTC
Call Tree/Graph Viewer

Not only "Find Usage" - why can't C users have a "Function Call Tree" view -
either organised by caller or by callee.

This used to be a standard part of IDEs such as Borland, but has been
substituted with a Class Viewer - I don't say 'replaced' since a Class Viewer is
no replacement for a Call graph view !

Forgive me if this is in KDEv 3.0/Gideon ...
Comment 10 Paul Fee 2007-12-03 17:57:50 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 Paul Fee 2007-12-03 18:02:59 UTC
Doxygen includes similar information.  It has a call graph but (unfortunately) lacks a called-by graph.

It would also be nice if this feature was clever enough to understand C++ scoping rules, e.g. a call within foo::bar() to boo() could be a call to foo::boo() or boo() or a function within a namespace previously specified with "using namespace".

Grep will not provide enough intelligence to find such matches.  However it's not a bad start if use of a C++ AST is too complex.
Comment 12 Andreas Pakulat 2007-12-07 19:41:42 UTC
Just to get all these voters a bit excited: A basic experimental use-highlighter has been implemented in KDevelop4 the last days. AFAIK it currently highlights only usages of variables, but extending that shouldn't be much of a problem.
Comment 13 Andreas Pakulat 2008-06-29 15:52:06 UTC
comming in kdevelop4.
Comment 14 Amilcar do Carmo Lucas 2009-01-31 21:55:57 UTC
This is Fixed in KDevelop4
Take a look at "code navigation" blog on www.kdevelop.org for details