Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

source code browser for C / C++ code

113 views
Skip to first unread message

Rahul

unread,
Feb 5, 2008, 10:57:49 AM2/5/08
to
hi,

which is the best source code browser for c / c++ source code... on
windows.. better if its free download... i tried source navigator
5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
code...


i have a huge source code to dig into to fix bugs...


pls help...


-- rahul

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Le Chaud Lapin

unread,
Feb 5, 2008, 10:49:38 PM2/5/08
to
On Feb 5, 9:57 am, Rahul <phoenix....@gmail.com> wrote:
> hi,
>
> which is the best source code browser for c / c++ source code... on
> windows.. better if its free download... i tried source navigator
> 5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
> code...
>
> i have a huge source code to dig into to fix bugs...
>
> pls help...

IMHO, Visual Studio.

Visual Studio 2008 Express Edition is free: : http://tinyurl.com/2h9yma

{ Please use preview versions of short URLs, e.g.
http://preview.tinyurl.com/2h9yma. TIA., -mod }

-Le Chaud Lapin-

Sean Hunt

unread,
Feb 6, 2008, 5:13:35 AM2/6/08
to
On Feb 5, 8:57 am, Rahul <phoenix....@gmail.com> wrote:
> hi,
>
> which is the best source code browser for c / c++ source code... on
> windows.. better if its free download... i tried source navigator
> 5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
> code...
>
> i have a huge source code to dig into to fix bugs...
>
> pls help...
>
> -- rahul

In my opinion, if you configure Doxygen (http://doxygen.org/)
correctly, it can be superior to most code browsers.

If you run it with 'doxygen -g', it will create a template
configuration file. Make the following changes:

BUILTIN_STL_SUPPORT = yes
EXTRACT_ALL = yes
INPUT = the base directory (source and includes both)
FILE_PATTERNS = filepatterns for the files (e.g. *.cpp *.hpp), space-
separated
RECURSIVE = yes
SOURCE_BROWSER = yes
INLINE_SOURCES = yes

This is the basic options you probably will need to use. You can also
configure a number of other options. You can also pick a number of
output formats (LaTeX, HTML, UNIX manpage, RTF, XML, perlmod). If you
have the 'dot' tool, you can even make UML-like graphs for all the
classes, as well as caller and callee graphs.

These options I've given will cause Doxygen to show source code for
each function. You can also browse by source file. It's quite and
impressive program!

Sean

Thomas Lehmann

unread,
Feb 6, 2008, 5:12:31 AM2/6/08
to
> IMHO, Visual Studio.
>
> Visual Studio 2008 Express Edition is free: :http://tinyurl.com/2h9yma
>

Rahul meant "source code browser" - not IDE, did you?
If so you can use doxygen! (www.stack.nl/~dimitri/doxygen)
There is also a big list of projects using doxygen
and you can decide yourself by looking at some generated
documentation!

david...@gmail.com

unread,
Feb 6, 2008, 2:04:39 PM2/6/08
to
<snip>

> Rahul meant "source code browser" - not IDE, did you?

<snip>

VS, like I guess most modern IDEs, contains a source code browser. I
personally find it insanely convenient to use, especially as a
background parser thread updates the browser view as you code (i.e. no
rebuild is required).

Cheers,

Dave

Le Chaud Lapin

unread,
Feb 6, 2008, 2:02:34 PM2/6/08
to
On Feb 6, 4:12 am, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:
> > IMHO, Visual Studio.
>
> > Visual Studio 2008 Express Edition is free: :http://tinyurl.com/2h9yma
>
> Rahul meant "source code browser" - not IDE, did you?

Ja wohl!

> If so you can use doxygen! (www.stack.nl/~dimitri/doxygen)
> There is also a big list of projects using doxygen
> and you can decide yourself by looking at some generated
> documentation!

I used Doxygen once. I thought I was pretty cool, but as a minimalist,
I decided to stay with Visual Studio because it already has a good
subset of the same features.

First, A Bit Of Visual Studio Terminology For Non-Windows Programmers:

Let's say you're developing an editor/linker/compiler tool-chain.

VS sees three separate "projects", one for each a.out to be generated:

1. editor -- > a.out
2. compiler --> a.out
3. linker --> a.out

VS anticipates that the programmer will probably work on all three of
these projects simultaneously, and calls the collection-of-three the
"solution". This "solution" thing is what the programmer sees in the
IDE every day. He uses the mouse to hop around a visual hierarchy
where the multi-roots of the hierarchy are the names of the projects,
"editor", "compiler", "linker".

Then the fun begins.

VS has an active, real-time parser that monitors code input as the
programmer types each key. It keeps a structure in memory that is
refreshed just after compilation and as the programmer types so that
it is ready to display information about the code space of the entire
solution.

The user has the following options avaialble for browsing the code
space:

1. Solution Explorer
2. Bookmark Window
3. Class View
4. Code Definition Window
5. Object Browser
6. Callers Graph
7. Call Graph

Solution Explorer shows all the files in a solution in hierarchy
according to which project they are associated with. Double-click on
file, and new buffer window opens with file in it. Very simple.

Bookmark Window lets you place bookmarks (little blue squares by
default) at points in source code as you move around. "Forward" and
"backward" buttons work as they do with a web browser, to it becomees
easiy to hop around memorized points in the code space very quickly.
[Same as analogous feature in Emacs, using Meta-X key.]

Class View shows all the class in the entire solution in a hierarchy.
The roots of the hierarchy are the projects. For a particular project,
one can view:

a. namespaces of that project
b. global functions of the probject
c. classes specifically within that project.
d. etc.

Beneath the class, one and independently view each of:

a. base types
b. derived types
c. public members
d. private members
e. protected members
f. inherited members
g. nested classes
h. enumberations
i. etc.

As the user single-clicks on anything in the class view, the Code
Definition Window shows the corresponding code. The Code Defintion
Window is read-only, but a double-click on anything in Class View will
bring up editable buffer of corresponding code.

The Object Browser lets one see the entire universe of classes/etc.
that pertain to the solution, not just those defined by programmer,
but also those that result from say, #include <cstdio>. Naturally, the
number of classes that shows up in this view is very large. It
functions similarly to Class View. Single-click shows corresponding
code in Code Defintion Window. Double-click allows editing of
corresponding code in editable window.

Callers Graph allows one to select a function and see all functions in
entire solution that calls to that function.

Call Graph allows one to select a function and see all functions in
entire solution that is call by the function.

I vaguely recall an UML-generation tool also, though I never used it
and can't find it.

What's remarkable about all these features is that they are integrated
and real-time. If the programmer manages to load up a file in the
editor and do a compilation, all these views are ready-to-go. If the
programmer adds a new file to the solution and compiles, the new file
will be included in all these views. If the programmer addes a new
member function, the "documentation" changes almost instantly, in my
case 2.5 seconds. If you start writing gibbberish..like !*%^(...it
backs off and goes around until it finds regular state.

-Le Chaud Lapin-

Alex

unread,
Feb 6, 2008, 9:13:34 PM2/6/08
to
On Feb 6, 2:02 pm, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
> On Feb 6, 4:12 am, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:
>
> > > IMHO, Visual Studio.
>
> > > Visual Studio 2008 Express Edition is free: :http://tinyurl.com/2h9yma
>
> > Rahul meant "source code browser" - not IDE, did you?

If Rahul wants to get a grip of a large codebase, IDE with source
browser is no doubt better than running doxygen on it. Visual Studio
or Eclipse/CDT (in that order) is what I recommend.

http://www.eclipse.org/cdt/

Alex

Pavel Minaev

unread,
Feb 7, 2008, 1:29:22 PM2/7/08
to
On Feb 7, 5:13 am, Alex <ale...@gmail.com> wrote:

> If Rahul wants to get a grip of a large codebase, IDE with source
> browser is no doubt better than running doxygen on it. Visual Studio
> or Eclipse/CDT (in that order) is what I recommend.

Personally, I would also recommend Visual Assist, if Visual Studio is
chosen. I've found that, in general, it does a better jobs for more
complicated templates, and it provides its own code browser which may
be more convenient to use than the default one.

Jeff Koftinoff

unread,
Feb 7, 2008, 1:22:28 PM2/7/08
to
On Feb 5, 7:57 am, Rahul <phoenix....@gmail.com> wrote:
> hi,
>
> which is the best source code browser for c / c++ source code... on
> windows.. better if its free download... i tried source navigator
> 5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
> code...
>
> i have a huge source code to dig into to fix bugs...
>
> pls help...
>
>

I've been a fan of sourcenavigator for a long time (even with it
periodically crashing)... It has been neglected for quite a while
which is sad.

But just a few days ago I became happy again because someone else has
picked up the source navigator code and is running with it, actively
updating it now!

The new project is called source navigator ng:

http://sourcenav.berlios.de/

--jeffk++

ManicQin

unread,
Feb 7, 2008, 1:25:44 PM2/7/08
to
> which is the best source code browser for c / c++ source code... on
> windows.. better if its free download... i tried source navigator
> 5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
> code...
>
> i have a huge source code to dig into to fix bugs...

You can also try crystal flow I used it when I entered my last job and
it was most helpful,

http://www.sgvsarc.com/product_crystalflow.htm

Thomas Lehmann

unread,
Feb 7, 2008, 1:25:44 PM2/7/08
to
>
> > > Rahul meant "source code browser" - not IDE, did you?
>
> If Rahul wants to get a grip of a large codebase, IDE with source
> browser is no doubt better than running doxygen on it. Visual Studio
> or Eclipse/CDT (in that order) is what I recommend.
>
> http://www.eclipse.org/cdt/

Codebase? When Rahul is familiar with Vim, ctags and cscope he has
three
tools being >>very much faster<< as Visual Studio or Eclipse for
operations
like this:

- Where is it defined?
- Where is it used?
- Where is it called?

Vim also can be integrated into Visual Studio!

Le Chaud Lapin

unread,
Feb 8, 2008, 4:42:11 PM2/8/08
to
On Feb 7, 12:25 pm, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:
> > > > Rahul meant "source code browser" - not IDE, did you?
>
> > If Rahul wants to get a grip of a large codebase, IDE with source
> > browser is no doubt better than running doxygen on it. Visual Studio
> > or Eclipse/CDT (in that order) is what I recommend.
>
> >http://www.eclipse.org/cdt/
>
> Codebase? When Rahul is familiar with Vim, ctags and cscope he has
> three

I have no idea what Vim or ctags or cscope are, but I do know that if
you right-click on any symbol in a Visual Studio editor window, a pop-
up menu will show several options. You can then choose from that pop-
up menu:

> tools being >>very much faster<< as Visual Studio or Eclipse for
> operations
> like this:
>
> - Where is it defined?

[Go To Definition] (to see where it is defined)

> - Where is it used?

[Find All References] (to see where it is used)

> - Where is it called?

[Call Browser->Show Callers Graph] (to where it is called)

> Vim also can be integrated into Visual Studio!

And strangely, Visual Studio is integrated with Visual Studio. ;)

-Le Chaud Lapin-

Thomas Lehmann

unread,
Feb 11, 2008, 11:23:06 AM2/11/08
to
{ Accepted as follow-up, but in responses, please make the relevance to
C++ programming, as opposed to programming in general, clear. -mod }


> And strangely, Visual Studio is integrated with Visual Studio. ;)
>

Typical print of a Microsoft fan!
I don' want to make verbal fight against Visual Studio
and - as I still mentioned - the tool isn't bad for
very many things - especially for debugging!
(I've been working with it for many years)

But if you don't know vim, ctags or cscope you have simply
to live with slow searching! And searching is 90% of a
developers day, isn't it?

dave_m...@fastmail.fm

unread,
Feb 11, 2008, 11:28:38 AM2/11/08
to
On Feb 8, 4:42 pm, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
> On Feb 7, 12:25 pm, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:

> > Vim also can be integrated into Visual Studio!
>
> And strangely, Visual Studio is integrated with Visual Studio. ;)

Vim, like C++, is supported on Windows, Unix, MacOS, and other
platforms.

Le Chaud Lapin

unread,
Feb 11, 2008, 11:05:04 PM2/11/08
to
On Feb 11, 10:23 am, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:
> { Accepted as follow-up, but in responses, please make the relevance to
> C++ programming, as opposed to programming in general, clear. -mod }
>
> > And strangely, Visual Studio is integrated with Visual Studio. ;)
>
> Typical print of a Microsoft fan!

Hah!

I'm an objectivist. I try to call it as I see it. If you read my post
history, you'll see that I was prepared to castigate Microsoft
relentlessly for attempt to, in my opinion, subvert C++ by calling C++/
CLI a "natural progression of C++" and naming one of their articles
"Pure C++" when it was anything but. I also castigate Microsoft
regularly when I have nothing better to do, as I *absolutely destest*
the notion of .NET, and the idea that there is One Universal Object
Model, that the type system of C++ is compatible with the type system
of other languages.

> I don' want to make verbal fight against Visual Studio
> and - as I still mentioned - the tool isn't bad for
> very many things - especially for debugging!
> (I've been working with it for many years)
>
> But if you don't know vim, ctags or cscope you have simply
> to live with slow searching! And searching is 90% of a
> developers day, isn't it?

I guess the only reason I responded to your post is that I spend much
of my time trying to keep programmers from making a mess of the work
environment with all kinds of tools. Very frequently, someone will
drag in an animal they found in woods not understanding why we cannot
keep it, and I asquiesced to every request to keep a new pet, I'd be
running a large zoo containing every type of animal imaginable. These
animals would have to be fed and tended too. Some of them get sick.
They tend to bite the other animals and their owners fight over which
is prettiest.

Redundancy in tool-set is harmful, IMO.

A relevant example is these XML/C++ converters.

We store the configuration of a program on disk. One of my engineers
got bit by the XML bug several years ago and uses an XML parser thing
(MSXML, I think) to tediously parse code written in XML on disk to get
it into C++ objects in RAM, when he could just-as-well serialize the C+
+ objects to and from disk and forget about XML. He has since given
up the illusion that there is magic in XML, that it is so clever that,
you can add a new field to an "object" in the XML file, and everything
will take care of itself in C++ automatically. He now knows that the
programmer still has to actively think about form and semantics for
each change made.

There really is no reason to use XML. The data is strictly internal,
and will never be shared with anyone, and is never seen or edited by
human, and the format is implicitly documented by the C++ object
hierarchy, yet he still uses it...because he likes it.

We're about to do a major code conversion, and one of the things that
I have marked for the chopping block is that XML/C++ "converter".

Minimalism is important in engineering.

-Le Chaud Lapin-

Thomas Lehmann

unread,
Feb 14, 2008, 2:40:47 AM2/14/08
to
>
> I guess the only reason I responded to your post is that I spend much
> of my time trying to keep programmers from making a mess of the work
> environment with all kinds of tools....

Basically I'm of your opinion but there a few things to note:
- I tried to install a wiki called "moinmoin" and I hate
to setup several tools and databases and servers to make
the whole thing run. But I have had big luck! The moinmoin
team has also provided a desktop version - a simple standalone
server and I have nothing else to but run it (nearly).
Here we are with the Visual Studio, are we?

- But ... also we will find out that the required basic knowledge
to do something with "some" tools is acceptable. I have
organized to provide the documentation of our whole sources
with dependency graphs, with sequence diagramms and all those
stuff provided by doxygen and dependend tools. Each coder simply
has to recognize a really little styleguide only to get a valuable
result and he only has to add a URL to his browsers favourites
to access the documentation and the search engine - also provided
by doxygen. Same with ctags and csope. A shell script generated
each night the database and nobody requires to know - each day - how
this database has been created. Someone could read the shell - I have
provided many comments also the shell script fits to one
screen (or less).

- And most effort is required for C++: This language is complex and the
most high end products are not able to provide every required feature.
Two good examples: Programming Java I found myself surprised working with
eclipse because everything from code analysis, to parallel debugging,
metric and unit-testing is covered by one product but wait ...
you have to install some plugins but then it's quite fine ...
Same for C#. Working with Visual Studio and C# you will have a similar
environment! Unfortunately not for C++!

This will be my last post to this topic; my only intention was to offer
possibilities. We never will be able to avoid differences in opinions
so Vim users, Emacs users or big IDE's users will be always different
communities but every of it - really every - has very nice things and
you simply should know of this...

sincerely
Thomas

jackwa...@gmail.com

unread,
Feb 14, 2008, 7:32:11 AM2/14/08
to
On Feb 5, 11:57 pm, Rahul <phoenix....@gmail.com> wrote:
> hi,
>
> which is the best source code browser for c / c++ source code... on
> windows.. better if its free download... i tried source navigator
> 5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
> code...
>
> i have a huge source code to dig into to fix bugs...
>
> pls help...

{ Edits: quoted signature and clc++m banner removed. -mod }

up to u,
I like eighter Source Insight, Emacs+ecb,gVim, the VC2008.

use each for choose your favor

Matthias Buelow

unread,
Feb 14, 2008, 6:26:02 PM2/14/08
to
Thomas Lehmann wrote:

> - And most effort is required for C++: This language is complex and the
> most high end products are not able to provide every required feature.
> Two good examples: Programming Java I found myself surprised working with
> eclipse because everything from code analysis, to parallel debugging,
> metric and unit-testing is covered by one product but wait ...
> you have to install some plugins but then it's quite fine ...
> Same for C#. Working with Visual Studio and C# you will have a similar
> environment! Unfortunately not for C++!

The problem is that parsing C++ is undecidable and even more so (...) of
course for partial and invalid code in a text editor. The same applies
to other programming languages, even to Lisp, which has a very regular
syntax and has been used for the avantgarde of "visual" development
tools and IDEs, 20 years ago. Only for simple programming systems with a
very rigid, idiomatic and bureaucratic mode of development can this work
approximately (I count Java and C# among these programming systems.)
However, these modes of development are not very well suited to many
problems (they perform badly where the problem is not well specified,
where a solution has yet to be found, and anywhere where explorative or
flexible development is required, that is, in most real-life projects.)
Trying to machine-understand source code so that the programmer can
master its complexity whereas he couldn't without the machine's help is
a fruitless exercise and imho also points to the wrong direction. If you
need to do that kind of thing, having to press buttons to find your way
through the source, then you're either using the wrong notation
(programming language(s)) for the problem or the wrong methodology
(messy, discombobulated source code[1]). Programs are always mainly for
people to read and understand, and for machines to parse only as a
second thing.


[1] I know that people often don't have a say in what source code base
they are assigned to work on...

Sohail Somani

unread,
Feb 14, 2008, 6:26:40 PM2/14/08
to
On Wed, 06 Feb 2008 20:13:34 -0600, Alex wrote:

> On Feb 6, 2:02 pm, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
>> On Feb 6, 4:12 am, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:
>>
>> > > IMHO, Visual Studio.
>>
>> > > Visual Studio 2008 Express Edition is free:
>> > > :http://tinyurl.com/2h9yma
>>
>> > Rahul meant "source code browser" - not IDE, did you?
>
> If Rahul wants to get a grip of a large codebase, IDE with source
> browser is no doubt better than running doxygen on it. Visual Studio or
> Eclipse/CDT (in that order) is what I recommend.
>
> http://www.eclipse.org/cdt/
>
> Alex

Uh, no. Visual Studio barely works on non-C-like C++ code. If your team
has a habit of using Doxygen from the get-go, the benefits are
tremendous. Whoever suggested Doxygen was a genius. Given a relatively
non-traditional C++ codebase, Doxygen has done well where Visual Studio
has very badly failed.

On a slight tangent, I find that Emacs + etags works better for code
lookups than Visual Studio. The only nagging problem I have is that the
TAGS file is not updated as you edit. I shouldn't speak to CDT as I tried
it a long time ago and it is probably a lot better now.

As these things go, YMMV :-)

--
Sohail Somani
http://uint32t.blogspot.com

Alex

unread,
Feb 15, 2008, 3:49:59 PM2/15/08
to
On Feb 14, 6:26 pm, Sohail Somani <soh...@taggedtype.net> wrote:
> On Wed, 06 Feb 2008 20:13:34 -0600, Alex wrote:
> > On Feb 6, 2:02 pm, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
> >> On Feb 6, 4:12 am, Thomas Lehmann <t.lehm...@rtsgroup.net> wrote:
>
> >> > > IMHO, Visual Studio.
>
> >> > > Visual Studio 2008 Express Edition is free:
> >> > > :http://tinyurl.com/2h9yma
>
> >> > Rahul meant "source code browser" - not IDE, did you?
>
> > If Rahul wants to get a grip of a large codebase, IDE with source
> > browser is no doubt better than running doxygen on it. Visual Studio or
> > Eclipse/CDT (in that order) is what I recommend.
>
> Uh, no. Visual Studio barely works on non-C-like C++ code.

I beg to differ. I use it on a daily basis and it parses C++ mighty
fine. In fact, so much so that, since 2005, I am not tempted to look
for alternatives. If your statement were true, VS would barely be
capable of producing the executable. However, as it turns out, it is
a de-facto standard on win32 platform.

> Whoever suggested Doxygen was a genius. Given a relatively
> non-traditional C++ codebase, Doxygen has done well where Visual Studio
> has very badly failed.

I beg to differ again. It would be nice to hear some facts, not just
vague derogatory claims, such as 'barely works' and 'badly failed'.
Also, I'm not sure what 'non-traditional C++ codebase' is?

> On a slight tangent, I find that Emacs + etags works better for code
> lookups than Visual Studio.

We've had a vim proponent already. Now we have an Emacs one. It only
proves that one can not argue about taste. Mine happens to be with VS
and CDT, i.e. integrated code browsing, editing, debugging and
compiling with GUI interface and delivered in a single package that is
simple to setup. If you like something else, more power to you.

Alex


--

v.krish...@gmail.com

unread,
Feb 24, 2008, 4:43:03 AM2/24/08
to
On Feb 5, 8:57 pm, Rahul <phoenix....@gmail.com> wrote:
> hi,
>
> which is the best source code browser for c / c++ source code... on
> windows.. better if its free download... i tried source navigator
> 5.1.4 and 5.2b2.. but it is crashing while parsing the c++ source
> code...
>
> i have a huge source code to dig into to fix bugs...
>
> pls help...
>

OpenGrok - http://opensolaris.org/os/project/opengrok/

Cheers,
-Krishna

0 new messages