Hi, I believe I asked this question about four years ago and as I recall, there was things on the horizon that seemed hopeful so I thought I would ask again.
Is there a way to have gcc produce some type of intermediate file that could be used to generate a cscope like database. (Perhaps a better way to phrase the question is 'which intermediate file, if any, could be used') I have a few issues with cscope that I keep hoping to solve somehow someday. Here is a short list of them: 1) cscope doesn't really parse the input so it very often gets rather confused. It does a wonderful job over all but it isn't 100%. My thought is to produce some file for each compile run. e.g. from foo.c, an extra file perhaps called foo.t would be produced. The foo.t files would then be processed and a unified database created. Then tools would be written to rummage around in the database. 2) If struct dog x; x.y = 5; is seen, then cscope does not know that y is a field of dog. Often, programmers use too simple of a name and if I do cscope for "y",I get way too many hits. It would be nice if I could search for dog.y and find places where it is referenced. Separating l and r values would be nice too. This implies that the foo.t files be fairly sophisticated in what they are reporting. But, it is obviously nothing that the compiler doesn't already know at the time it is doing the compile. 3) I don't know what to do about CPP macros. cscope does not look inside of them so you can search for the macros directly. With output coming from the latter stages of the compiler, the original text may have been lost. Perhaps the foo.t output might need to be combined with an intermediate file from CPP. Thank you for your time, Perry