On 10 November 2011 16:08, Basile Starynkevitch wrote: > On Thu, 10 Nov 2011 12:54:52 +0000 > Jonathan Wakely <jwakely....@gmail.com> wrote: > >> Doesn't DWARF debug info already contain all that info anyway? > > It is not a textual file, and it is not easily parsable. Nobody would write a > DWARF > parser in a few hundreds lines of Emacs Lisp.
But it contains all the information you want, and the compiler already produces it, today. It's certainly possible to turn the dwarf info into a textual format. Why is a new format with the same info needed, and why does it need to be incorporated into the compiler? >> >> > Of course, such a thing could be done by some GCC plugin, but I believe >> > providing the >> > feature inside GCC itself, and documenting the format of the textual type >> > annotation >> > file, would give this feature more visibility, and it would help people a >> > lot. And I am >> > pretty certain that the C++ frontend does compute the type of each >> > expression, so it is >> > mostly the point of defining a textual type annotation format and output >> > it. >> >> What's the point of plugins if they aren't used to do this sort of thing? > > In that precise case (generating type annotation) I believe it is a common > enough need to > be provided by the compiler. And by experience, most people don't use > plugins. Having two > arguments like eg > g++ -fplugin=c++-type-annotation > -fplugin-arg-c++-type-annotation-output=myfile.annot) > makes a difference with having one argument: > -fc++-type-annotation=myfile.annot And -g is even easier Most people don't use plugins because they're new and there aren't many useful ones yet. > I agree there is a chicken & egg issue: editors (or IDE-s) won't provide the > framework to > use that as log as GCC won't produce them, and vice versa. DWARF already provides the info, the fact editors aren't using it makes me think they wouldn't use the same info in another format. Adding this to GCC seems like a total waste of time, write a dwarf processor that dumps the info you want.