This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Source code database


Mathieu Lacage <Mathieu.Lacage@sophia.inria.fr> writes:
> if (foo.GetData ())
>
> Imagine the user clicks in his IDE view on the foo string. I want to
> figure out what this string is: variable ? macro ? If variable, its type
> ? If macro, what does the preprocessor transform it into given the
> compiler's command-line arguments ?
>
> The hard part here is associating the "foo" string with something which
> represents the high-level langage object: I do not want to use heuristics

My project might be of use to you:
    http://www.nongnu.org/myer/README.html

It includes patches for gcc to emit tokens with type, UID, and (line,col)
spots in the source code.  Then it combines multiple compilation units to
create a global list of spots where each high-level object is used -- useful
for your IDE.  Then it computes metrics and generates HTML output -- you
don't need these parts.  Myer is currently an alpha release, but I'd be more
interested in cleaning it up if someone was actually using it.


>   - if I can provide a patch which generates an enough-detailed dump for
> my application and not-enough detailed for a code generator, would it be
> at least considered for inclusion in the main source tree ?

I'll second this question!


> A bit of googling showed that the topic of dumping internal compiler
> information into a database is pretty controvertial.

IANAfsL, but it seems absurd to me that use of my patched gcc output could
infect a target program with GPL.  My output is basically just transformed
source code with UID's added.  It's not "partially compiled", just
"annotated".  The choice of which code spots get assigned the same UID is
not "internal compiler data", but part of the specification of C semantics.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]