From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18211 invoked by alias); 19 Jul 2006 20:35:07 -0000 Received: (qmail 18194 invoked by uid 22791); 19 Jul 2006 20:35:06 -0000 X-Spam-Check-By: sourceware.org Received: from hq.tensilica.com (HELO mailapp.tensilica.com) (65.205.227.29) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Jul 2006 20:35:01 +0000 Received: from localhost ([127.0.0.1] ident=amavis) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1G3Il1-0000qS-7y for gdb-patches@sources.redhat.com; Wed, 19 Jul 2006 13:34:59 -0700 Received: from mailapp.tensilica.com ([127.0.0.1]) by localhost (mailapp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03056-03 for ; Wed, 19 Jul 2006 13:34:59 -0700 (PDT) Received: from heron.hq.tensilica.com ([192.168.11.123]) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1G3Il0-0000qM-Tr for gdb-patches@sources.redhat.com; Wed, 19 Jul 2006 13:34:58 -0700 Received: from [192.168.1.100] (unknown [172.16.19.204]) by heron.hq.tensilica.com (Postfix) with ESMTP id 59232AC0E6 for ; Wed, 19 Jul 2006 13:34:58 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.2) To: gdb-patches@sources.redhat.com Message-Id: <4502EB65-3352-4094-8397-AD0E93913023@tensilica.com> Content-Type: multipart/mixed; boundary=Apple-Mail-4--1059644237 From: Bob Wilson Subject: [PATCH] print newline after copyright message Date: Wed, 19 Jul 2006 20:35:00 -0000 X-Mailer: Apple Mail (2.752.2) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00261.txt.bz2 --Apple-Mail-4--1059644237 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-length: 3188 Maybe I'm missing something here, but the way that GDB currently separates its copyright message from subsequent messages seems broken. The copyright message is printed without a newline at the end. Then, after handling .gdbinit, attaching to the exec file and loading the symbol file, the newline is finally printed. (But, for some reason, the newline comes before loading a core file.) During the interval between printing the copyright message and the subsequent newline, some attempt has been made to set error_pre_print, etc. to add a blank line between the copyright and any error/warning messages. Presumably there was a good reason for doing it this way, but if that reason still holds, I can't figure out what it is. I've found some problems with this scheme: *) Warnings are handled differently than errors, with no blank line to separate them from the copyright message. This makes them less visible, since people often get used to ignoring the copyright message. According to a comment in the code, since there may be multiple warnings, adding double newlines to warning_pre_print is not good because then they would all be double-spaced. This comment is not quite right, though.... *) Because warnings already end with newlines, the single newline added to warning_pre_print causes them to be double-spaced. (The comment should say that adding two newlines to warning_pre_print would make the warnings triple-spaced.) Also, the newline that is intended to end the copyright message ends up adding a blank line _after_ the warning. This looks bad. It's ironic -- the desired behavior would be a blank before the warning, but instead you get a blank after it. *) Some messages printed before the newline are neither errors nor warnings, e.g., "no debugging symbols found" from symbol_file_add_with_addrs_or_offsets in symfile.c. They may end up on the same line as the end of the copyright message. E.G.: This GDB was configured as "i486-linux-gnu"...(no debugging symbols found) OR This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "\ /lib/tls/i686/cmov/libthread_db.so.1". This is confusing: neither the lack of debugging symbols nor the libthread_db library has anything to do with how GDB was configured, but the message makes it sound like there is some connection. Here is a patch that fixes these problems, except for the double-spaced warnings. It prints the newline immediately after the copyright message. Since multiple warnings during this interval seem unlikely to happen often, I don't see the double-spaced issue as being so important, and the patch doesn't make that issue any different than it is now. Tested by building i686-pc-linux-gnu and running the testsuite -- there are some failures both with and without the patch and some of the threading-related failures differ but I don't think the differences have anything to do with the patch. 2006-07-19 Bob Wilson * main.c (captured_main): Print a newline after calling print_gdb_version instead of waiting until after the symbol file has been read. Adjust {error,quit,warning}_pre_print values. --Apple-Mail-4--1059644237 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=gdb-newline.diff Content-Disposition: attachment; filename=gdb-newline.diff Content-length: 1540 Index: main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.58 diff -u -r1.58 main.c --- main.c 21 Feb 2006 19:46:48 -0000 1.58 +++ main.c 18 Jul 2006 22:24:49 -0000 @@ -589,6 +589,7 @@ if (symarg) printf_filtered (".."); wrap_here (""); + printf_filtered ("\n"); gdb_flush (gdb_stdout); /* Force to screen during slow operations */ } @@ -623,13 +624,13 @@ if (symarg) printf_filtered (".."); wrap_here (""); + printf_filtered ("\n"); gdb_flush (gdb_stdout); /* Force to screen during slow operations */ } - error_pre_print = "\n\n"; + /* Set off error and warning messages with a blank line. */ + error_pre_print = "\n"; quit_pre_print = error_pre_print; - - /* We may get more than one warning, don't double space all of them... */ warning_pre_print = _("\nwarning: "); /* Read and execute $HOME/.gdbinit file, if it exists. This is done @@ -688,15 +689,6 @@ catch_command_errors (symbol_file_add_main, symarg, 0, RETURN_MASK_ALL); } - /* After the symbol file has been read, print a newline to get us - beyond the copyright line... But errors should still set off - the error message with a (single) blank line. */ - if (!quiet) - printf_filtered ("\n"); - error_pre_print = "\n"; - quit_pre_print = error_pre_print; - warning_pre_print = _("\nwarning: "); - if (corearg != NULL) { /* corearg may be either a corefile or a pid. --Apple-Mail-4--1059644237--