And I found a very useful option in gcc that can generate enough
information what I want
"gcc -fdump-translation-unit -c a.cpp -o a.o" and this command will
generate a file a.tu.
I browsed the .tu file and I was assured that I cound work based on
that.But when I wanted a complete the documentation to persuade my
manager,I got frustrated.Even in the GCC Internal Documentation,this
file format has not been mentioned.
Help!!!Is there some one here who had been working on this field?
Counld you give me some information where i can find the .tu file
format???Or would you be so kind to tell me is there any other better
way to extract the information from C++ source file???
3KS:-)
> Help!!!Is there some one here who had been working on this field?
> Counld you give me some information where i can find the .tu file
> format???Or would you be so kind to tell me is there any other better
> way to extract the information from C++ source file???
There is little to no documentation about any of the dump files
emitted by GCC. We use them for debugging the compiler and not much
else. The .tu dump has been used by some folks to do some analysis,
but it is certainly not the intent to produce a complete dump of the
internal representation.
The best way to understand the format of the .tu file is to study the
source code of the particular version of GCC that you are working with
(tree-dump.c:dump_node is a good start). Different versions of GCC
may include different information in it.
Have you thought about hooking your analysis directly as a GCC pass?
Diego.
Take a look at gcc-xml and pygccxml:
<http://www.gccxml.org/HTML/Index.html>
<http://www.language-binding.net/pygccxml/pygccxml.html>
--
Pertti
Yes,I have thought about it.But GCC-XML can't provide some information
about body of function.Unfortunately that's what i want.
gccxml seems to be a dead project there have been no updates for 11 months
(as of 17 oct 2008).
Armel