This is the mail archive of the
mailing list for the GCC project.
Re: MELT tutorial on the wiki
- From: Tom Tromey <tromey at redhat dot com>
- To: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 30 Jul 2009 15:17:03 -0600
- Subject: Re: MELT tutorial on the wiki
- References: <4A707003.firstname.lastname@example.org>
- Reply-to: tromey at redhat dot com
>>>>> "Basile" == Basile STARYNKEVITCH <email@example.com> writes:
Basile> I added as a turorial on the wiki, a small MELT pass which warns
Basile> against fprintf(stdout, ...) in the compiled code.
Basile> For GCC hackers, is the page
Basile> clear enough?
I've been looking for a very simple way to do some kinds of static
analysis on gdb, so today I tried building the MELT branch in hopes it
would serve this need. Unfortunately, it didn't compile.
With C++ enabled, I got this failure:
/space/tromey/MELT/gcc/libstdc++-v3/include/precompiled/stdc++.h:98:18: fatal error: chrono: No such file or directory
With just C enabled, I got:
make: *** No rule to make target `install-melt-headers', needed by `install'. Stop.
make: Leaving directory `/space/tromey/MELT/build/gcc'
In both cases I just configured with --disable-bootstrap --enable-melt,
plus the appropriate --enable-langauges option. This is on x86 F11.
Basile> (of course, the pass implementation is imperfect, but I have hard time
Basile> finding good *small* examples).
My gdb examples involve finding broken code that can't be diagnosed by
the compiler. Most of my examples are simple, but also actually useful.
For example, gdb has function that in the past could return null, but
which now cannot. So, I'd like to find all places where the return
result is checked.
Or, gdb has a TRY_CATCH macro which expands to a couple of nested loops.
It is not ok to 'return' or 'goto' from inside the inner loop, as this
causes hard-to-find bugs. So, it would be nice to find any place that
Or, there is a data type in gdb that used to be freed using 'xfree', but
which now requires a special function to be called instead. So, it
would be nice to find any place where xfree is passed an argument of
Etc. For my purposes, any kind of simple analysis pass that is simple
to hack and doesn't require me to learn too much would be ideal.