public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* -fdump-translation-unit does'nt dump as expected.
@ 2009-03-05 15:25 Praveen D V
  2009-03-20 19:13 ` Diego Novillo
  0 siblings, 1 reply; 5+ messages in thread
From: Praveen D V @ 2009-03-05 15:25 UTC (permalink / raw)
  To: gcc-help

hi Group,

Just updated gcc and ran into a problem
$gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-targets=all --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

My test file try.c
$cat try.c
typedef struct {
int j;
float k;
char l;
} MyStruct;

main()
{
MyStruct s = { 1, 3.2, 'a'};
}

$gcc -fdump-translation-unit try.c
 generates try.c.001t.tu (earlier versions generated try.c.tu). I
don't see any reference of MyStruct in the generated file.
Please help, am I missing any thing in the process?

--regards, Praveen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -fdump-translation-unit does'nt dump as expected.
  2009-03-05 15:25 -fdump-translation-unit does'nt dump as expected Praveen D V
@ 2009-03-20 19:13 ` Diego Novillo
  2009-03-23 14:17   ` Praveen D V
  0 siblings, 1 reply; 5+ messages in thread
From: Diego Novillo @ 2009-03-20 19:13 UTC (permalink / raw)
  To: Praveen D V; +Cc: gcc-help

On Thu, Mar 5, 2009 at 11:25, Praveen D V <for.pdv@gmail.com> wrote:

> $gcc -fdump-translation-unit try.c
>  generates try.c.001t.tu (earlier versions generated try.c.tu). I
> don't see any reference of MyStruct in the generated file.
> Please help, am I missing any thing in the process?

The dumps are meant to be used when debugging the compiler.  They are
not meant to be complete.  In particular global type definitions are
never dumped.


Diego.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -fdump-translation-unit does'nt dump as expected.
  2009-03-20 19:13 ` Diego Novillo
@ 2009-03-23 14:17   ` Praveen D V
  2009-03-23 14:28     ` Diego Novillo
  0 siblings, 1 reply; 5+ messages in thread
From: Praveen D V @ 2009-03-23 14:17 UTC (permalink / raw)
  To: Diego Novillo, gcc; +Cc: gcc-help

I was earlier using

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

This dumps every typedef.

With the new version I'm not able to get those dumps.
I just downloaded latest release and compiled it.  It too doesn't dump
those typedef trees.
Any other pointers?

--regards, Praveen

On Sat, Mar 21, 2009 at 12:42 AM, Diego Novillo <dnovillo@google.com> wrote:
> On Thu, Mar 5, 2009 at 11:25, Praveen D V <for.pdv@gmail.com> wrote:
>
>> $gcc -fdump-translation-unit try.c
>>  generates try.c.001t.tu (earlier versions generated try.c.tu). I
>> don't see any reference of MyStruct in the generated file.
>> Please help, am I missing any thing in the process?
>
> The dumps are meant to be used when debugging the compiler.  They are
> not meant to be complete.  In particular global type definitions are
> never dumped.
>
>
> Diego.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -fdump-translation-unit does'nt dump as expected.
  2009-03-23 14:17   ` Praveen D V
@ 2009-03-23 14:28     ` Diego Novillo
       [not found]       ` <00163646d11a7550550465fe2662@google.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Diego Novillo @ 2009-03-23 14:28 UTC (permalink / raw)
  To: Praveen D V; +Cc: gcc, gcc-help

On Mon, Mar 23, 2009 at 10:17, Praveen D V <for.pdv@gmail.com> wrote:

> With the new version I'm not able to get those dumps.
> I just downloaded latest release and compiled it.  It too doesn't dump
> those typedef trees.
> Any other pointers?

You will need to modify the GCC dump routines yourself to dump the
typedefs.  Start with dump_node and the calls made to dump_begin
(TDI_tu,...).

As I said before, these routines change almost constantly and we don't
even try to keep the output consistent.  They are just debug
instruments for us.


Diego.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: -fdump-translation-unit does'nt dump as expected.
       [not found]       ` <00163646d11a7550550465fe2662@google.com>
@ 2009-03-26 13:48         ` Diego Novillo
  0 siblings, 0 replies; 5+ messages in thread
From: Diego Novillo @ 2009-03-26 13:48 UTC (permalink / raw)
  To: for.pdv; +Cc: gcc-help

On Thu, Mar 26, 2009 at 00:35,  <for.pdv@gmail.com> wrote:
> Dear Diego,
> Thanks for your mail.
> Are you suggesting to modify gcc code? I have never touched gcc code.

Yes.

> Can you help me on how to do that?

Well, you can start by getting familiar with GCC sources and build
process.  A good starting point with links to various documents is
http://gcc.gnu.org/wiki/GettingStarted/

Feel free to ask questions on specific things that you are having trouble with.


Diego.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-26 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-05 15:25 -fdump-translation-unit does'nt dump as expected Praveen D V
2009-03-20 19:13 ` Diego Novillo
2009-03-23 14:17   ` Praveen D V
2009-03-23 14:28     ` Diego Novillo
     [not found]       ` <00163646d11a7550550465fe2662@google.com>
2009-03-26 13:48         ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).