Is there a tool to depict function/class relationship in source code

This is a discussion on Is there a tool to depict function/class relationship in source code within the C++ Programming forums, part of the General Programming Boards category; I am reading a big source code and got confused by function calls/ class inheritance. I was wondering if there ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    284

    Is there a tool to depict function/class relationship in source code

    I am reading a big source code and got confused by function calls/ class inheritance.
    I was wondering if there is an off-the-shelf tool to show the relationships between the function calls.
    Is there such a tool?

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    266
    do you mean that the source is so large that you are having trouble finding out what countless data structures and functions do?

    on linux I usually just 'grep' the folder and search for the function i am interested in

    but yea .. an auto-make UML diagram thing would be awesome

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    284
    Thanks. Basically what I want is that: I want a big picture of function call relationship in a source code. Given a function I can know who's the caller, and who are the caller's callers, etc. I want this depicted in a tree/graph.

    Quote Originally Posted by rodrigorules View Post
    do you mean that the source is so large that you are having trouble finding out what countless data structures and functions do?

    on linux I usually just 'grep' the folder and search for the function i am interested in

    but yea .. an auto-make UML diagram thing would be awesome

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    MSVS has the class browser that does this. If you are not using MSVS I'm sure there are some third party tools that do this. I think Google would be your best bet.

    Most UML programs can reverse engineer your code and produce UML which will show you the inheritance hierarchy quite nicely. Enterprise Architect is very good and Microsoft Visio is also pretty decent but not as good as the former.

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    266
    heh Yo-yo problem - Wikipedia, the free encyclopedia

    visio parses code? (never used)

  6. #6
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,235
    Grab Doxygen and run it on your source tree.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  7. #7
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    On Linux, Umbrello does a wonderful job of that bidirectionally (UML to code and code to UML.Umbrello UML Modeller Screen Shots
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to make a program that prints it's own source code???
    By chottachatri in forum C++ Programming
    Replies: 38
    Last Post: 03-28-2008, 07:06 PM
  2. DxEngine source code
    By Sang-drax in forum Game Programming
    Replies: 5
    Last Post: 06-26-2003, 05:50 PM
  3. Lines from Unix's source code have been copied into the heart of Linux????
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-19-2003, 03:50 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. C source code for int25 or code help
    By Unregistered in forum C Programming
    Replies: 0
    Last Post: 09-26-2001, 02:04 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21