Looking for tool to generate C/C++ crossrefs

Andrew Berg <andrewb@cs.washington.edu>
4 Oct 1998 01:15:00 -0400

          From comp.compilers

Related articles
Looking for tool to generate C/C++ crossrefs andrewb@cs.washington.edu (Andrew Berg) (1998-10-04)
Re: Looking for tool to generate C/C++ crossrefs ok@atlas.otago.ac.nz (Dr Richard A. O'Keefe) (1998-10-06)
Re: Looking for tool to generate C/C++ crossrefs keil@ert.rwth-aachen.de (Wolfgang Keil) (1998-10-07)
Re: Looking for tool to generate C/C++ crossrefs ludemann@inxight.com (1998-10-10)
Re: Looking for tool to generate C/C++ crossrefs jaxon@soltec.net (Greg Jaxon) (1998-10-13)
| List of all articles for this month |

From: Andrew Berg <andrewb@cs.washington.edu>
Newsgroups: comp.compilers
Date: 4 Oct 1998 01:15:00 -0400
Organization: Compilers Central
Keywords: C, C++, tools, question, comment

I am looking for a tool to generate cross references for a collection
of C/C++ source and header files. Basically all I want is for each
symbol to know the line it is defined on and the lines it is
referenced on. Ideally this would include preprocessor macros.


I have considered so far:


Writing my own. This looks like a lot of work even if I start with
existing C/C++ grammars and just add the 100 lines or so to keep track
of the symbols, because I still have to write my own preprocessor to
resolve macros. Does anybody know how to avoid doing that?


Building a custom gcc. Making a gcc just dump out the stuff I need
may or may not be so hard, I have not looked, but it is my
understanding that I will not have any information about the macros.
Can anybody confirm or deny this?


Is there any other options that I just don't see?


Thanks,


-andrew
[There are various ways to fake it, e.g., compile to assembler or
object and extract the symbols from there, but doing a good
crossreference is a challenge, particularly if you want to do
something reasonable with symbols mentioned in macros and the like.
-John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.