Thread: command line source navigation tools

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    1

    command line source navigation tools

    Q1 I've seen the way 'less' can interact with ctags...
    i.e. less -t <tagname> firing up sourcecode for a function definition...
    Anyone know the most convineint way of making a directory recursive version of this behaviour?

    Q2 are there command line tools for linux to generate and navigate call-graphs and so on from c/c++ source?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by ceti331 View Post
    Q1 I've seen the way 'less' can interact with ctags...
    i.e. less -t <tagname> firing up sourcecode for a function definition...
    Anyone know the most convineint way of making a directory recursive version of this behaviour?
    Have you looked at cscope? Its interface is more complicated than a simple command line but it works inside a terminal. I use it plugged straight into emacs.

    Q2 are there command line tools for linux to generate and navigate call-graphs and so on from c/c++ source?
    Do you want to do this statically, as in generate a printout of the program graph? I've never had the need to do that, but I use cscope all the time to jump around in code quickly. It's easy to ask where a function or symbol is defined, every location where it is referenced, get a list of all functions called by function X(), get a list of all functions which call function X(), etc.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Doxygen perhaps?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Threads to keep the CPU faster than the disk?
    By matthew180 in forum C Programming
    Replies: 4
    Last Post: 06-06-2007, 03:23 PM
  2. Source routing
    By failure_to in forum Networking/Device Communication
    Replies: 2
    Last Post: 06-04-2004, 04:34 PM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  4. source style recommendations: in search of...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-04-2001, 07:51 PM