Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GCC -fdump-translation-unit .tu file format

289 views
Skip to first unread message

dirtys...@gmail.com

unread,
Oct 15, 2008, 2:05:51 AM10/15/08
to
Hello,everyone:
I am working on extracting some useful information about C++ source
program like Template information,Class Hirerachy and Variable
Declarations .etc.

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:-)

Diego Novillo

unread,
Oct 15, 2008, 6:53:24 PM10/15/08
to
On Wed, Oct 15, 2008 at 02:05, dirtys...@gmail.com <dirtys...@gmail.com> wrote:

> 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.

Pertti Kellomaki

unread,
Oct 16, 2008, 3:02:06 AM10/16/08
to
dirtys...@gmail.com wrote:
> Or would you be so kind to tell me is there any other better
> way to extract the information from C++ source file???


Take a look at gcc-xml and pygccxml:

<http://www.gccxml.org/HTML/Index.html>
<http://www.language-binding.net/pygccxml/pygccxml.html>
--
Pertti

dirtys...@gmail.com

unread,
Oct 17, 2008, 3:12:41 AM10/17/08
to
On 10TB16HU, OBNg3J1027V, Pertti Kellomaki <pertti.kellom...@tut.fi> wrote:

Yes,I have thought about it.But GCC-XML can't provide some information
about body of function.Unfortunately that's what i want.

Armel

unread,
Oct 17, 2008, 7:17:58 AM10/17/08
to
"Pertti Kellomaki" <pertti.k...@tut.fi> a icrit dans le message de

gccxml seems to be a dead project there have been no updates for 11 months
(as of 17 oct 2008).

Armel

0 new messages