This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch trunk] in memory pretty-printing


On Thu, Jun 18, 2009 at 5:03 PM, Basile
STARYNKEVITCH<basile@starynkevitch.net> wrote:
> Hello All,
>
> The attached patch (to trunk rev148659) is a port from the MELT branch
> (which did test it quite significantly for the added features.).
>
> The insight is that some plugins might want or need to pretty print (notably
> for debugging purpose) outside of a FILE*. Using fmemopen is not portable

"Might want or need".

I don't see a reason for pushing in things that are incomplete and
are not needed now.

And fmemopen is good enough - plugin hosts are already restricted
anyway.

Richard.

> (of course a future GCC in C++ would use ostream-s in C++).
>
> So I added inside the output_buffer struct of pretty-print.h a generating
> routine pointer with its client data to pretty-print either into a FILE* if
> stream is given, or thru the given routine otherwise.
>
> I also exported dump_gimple_seq, needed by MELT & definitely useful to other
> plugins.
>
> Of course, a lot of debugging output would need to be also patched. To make
> this patch safe, I added tests in gimple-pretty-print.c to check for the
> buffer field of output_buffer-s (and do nothing if it is a null FILE*).
>
> The patch did bootstrap on x86-64-gnu-linux ie Debian/Sid/AMD64.
>
> Ok for trunk?



> Regards.
>
> PS: In an ideal, marvelous, but unrealistic world, one could imagine that
> every debug & dump I/O should go thru a specific abstract stream, similar to
> the ostream class of C++ or something even better than the IO channels of
> GTK http://library.gnome.org/devel/glib/stable/glib-IO-Channels.html but
> that is not realistic, it would be a huge patch [difficult to code, too big
> to be reviewed]. The proposed patch is much less ambitious and is not
> entirely complete, but does work.
>
> --
> Basile STARYNKEVITCH ? ? ? ? http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]