Generating object files from translation unit dumps?

Rajeev Joshi rjvjsh@hotmail.com
Thu Feb 12 03:08:00 GMT 2004


Hi, Diego,

Thanks for the reply.

>No.  .tu dumps are incomplete on purpose.  This is a long standing
>policy which has been debated at times, but we still need to follow it.

Is this incompleteness documented anywhere, by any chance?

>You will need to implement your analysis inside GCC.  What are you
>looking to implement?  Perhaps we could help you with that.

Actually, at the moment, I just wanted to play with writing a
little tool that could automatically introduce certain statements
(e.g., printfs and asserts) into a program, in order to make it easier
to debug.  But a secondary goal is just to get familiar enough
with gcc in order to play with writing my own static analysers.
(Yes, I know there are many static analysers available for C/C++,
but there's a lot of room for improvement.)

In thinking of how to structure such a tool, there seemed to
me to be 3 options:
(a) start with the .tu file, modify it, write it out as another .tu file
     and then generate object code
(b) start with the .tu file, modify it, write it out as a .c file, and then
     run gcc as usual
(c) implement the analysis inside gcc

>From your reply, (a) is ruled out.  Is (b) also not possible?
The problem with (c) is that it seems less portable; essentially
I have to keep up with any changes made to the data structures
used by gcc.  (Of course, (a) and (b) rely on the .tu file format,
but I was hoping this doesn't change too often.)

Cheers,
- Rajeev

_________________________________________________________________
Check out the coupons and bargains on MSN Offers! 
http://shopping.msn.com/softcontent/softcontent.aspx?scmId=1418



More information about the Gcc mailing list