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: PING PATCH: break lines in announce_function


On Wed, May 16, 2012 at 3:38 PM, Basile Starynkevitch
<basile@starynkevitch.net> wrote:
> On Wed, May 16, 2012 at 03:29:12PM +0200, Richard Guenther wrote:
>> On Wed, May 16, 2012 at 3:18 PM, Basile Starynkevitch
>> <basile@starynkevitch.net> wrote:
>> > On Wed, May 16, 2012 at 03:02:39PM +0200, Richard Guenther wrote:
>> >> On Wed, May 16, 2012 at 2:46 PM, Basile Starynkevitch
>> >> <basile@starynkevitch.net> wrote:
>> >> > Hello All,
>> >> >
>> >> > I am pinging the patch http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00474.html
>> >> > below for trunk svn 187587
>> >
>> > --- gcc/toplev.c ? ? ? ?(revision 187587)
>> > +++ gcc/toplev.c ? ? ? ?(working copy)
>> > @@ -229,6 +229,11 @@ announce_function (tree decl)
>> > ?{
>> > ? if (!quiet_flag)
>> > ? ? {
>> > + ? ? ?static long count;
>> > + ? ? ?count++;
>> > + ? ? ?if (count % 8 == 0)
>> > + ? ? ? ?putc('\n', stderr);
>> > +
>> > ? ? ? if (rtl_dump_and_exit)
>> > ? ? ? ?fprintf (stderr, "%s ",
>> > ? ? ? ? ? ? ? ? identifier_to_locale (IDENTIFIER_POINTER (DECL_NAME (decl))));
>> >
>> >
>> >> So - why? ?I like it the way it is.
>> >
>> > Because, as I explained in ?http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00474.html without that patch
>> > you have arbitrarily long output lines, and that is unpleasant, in particular when running under gdb
>> > or under emacs (also, there may be buffering issues: if GCC misbehave, stderr might not be flushed
>> > often enough...)
>>
>> stderr is unbuffered
>>
>> > The announce_function is quite rarely really used (because quiet_flag is almost always true),
>> > and it is used mostly to debug GCC (or plugins), and in that case having not too large output
>> > is quite useful in practice. The patch above is quick & dirty but seems enough.
>> > Do you want me to add a comment like /* Hack to avoid very large output lines. ?*/ before?
>>
>> No, I want the large line to stay as-is. ?It's pleasant for me.
>
>
> Do you have any hints or tricks to have this work well when running cc1 under emacs
> (eg in a *shell* or *gud-cc1* Emacs buffer)?
>
> Without that patch displaying happen too late (and eats a lot of Emacs CPU)!!

1) Fix emacs (do not buffer stderr)
2) do not omit -quiet when running from inside emacs

Richard.


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