This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Need doc of debug output produced by -fdump-translation-unit
- From: Don Lindsay <lindsayd at cisco dot com>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: Holger Peine <peine at iese dot fraunhofer dot de>, <gcc at gcc dot gnu dot org>
- Date: Wed, 9 Jun 2004 16:00:14 -0700 (PDT)
- Subject: Re: Need doc of debug output produced by -fdump-translation-unit
On Mon, 7 Jun 2004, Jim Wilson wrote:
> Holger Peine wrote:
> > I would like to use gcc as a front-end for a source code analysis tool.
> > gcc -fdump-translation-unit produces output which seems quite promising
> > for my purpose. Is the format of that output documented anywhere?
>
> No. This info is only intended to help with debugging gcc, and it is
> deliberately incomplete in some ways.
>
> FSF policy forbids us from writing information into intermediate files
> and then reading it back in later. This is because of concerns that
> someone might use this feature to subvert the GPL. If a proprietary
> compiler can exchange intermediate files with gcc, then they can avoid
> linking with any gcc code, and thus avoid the GPL. The
> -fdump-translation-unit stuff is thus intentionally crippled to try to
> prevent this from happening.
>
> Many of us would like to see this policy changed, as it hampers gcc
> development, but we must respect FSF policy.
Umm, Holger didn't ask for a way to do that. He wants the information to
go out, and not come back. I doubt he needs completeness, either: I don't.
Is there a way to do what he *does* want to do? Could we, please, arrange
for there to be one? Frozen enough so that my tooling isn't regularly
broken?
In my case, I'd love to trawl through the dump, to find e.g. the root data
types of all the arguments to a given function call, so that I could do
some extra argument checking. Or, find the signature of a given function,
so that I can verify its compliance to a local API, or generate
marshalling code for a remote call to it.
--
Don