* [PATCH] print newline after copyright message
@ 2006-07-19 20:35 Bob Wilson
2006-07-24 20:18 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Bob Wilson @ 2006-07-19 20:35 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 3188 bytes --]
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 <bob.wilson@acm.org>
* 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.
[-- Attachment #2: gdb-newline.diff --]
[-- Type: application/octet-stream, Size: 1540 bytes --]
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.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] print newline after copyright message
2006-07-19 20:35 [PATCH] print newline after copyright message Bob Wilson
@ 2006-07-24 20:18 ` Daniel Jacobowitz
2006-07-24 20:43 ` Bob Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-07-24 20:18 UTC (permalink / raw)
To: Bob Wilson; +Cc: gdb-patches
On Wed, Jul 19, 2006 at 01:33:34PM -0700, Bob Wilson wrote:
> 2006-07-19 Bob Wilson <bob.wilson@acm.org>
>
> * 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.
>
Thanks, I agree with your logic. This patch is OK. Please don't use
{A,B} notation in changelogs, though - spell it out.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] print newline after copyright message
2006-07-24 20:18 ` Daniel Jacobowitz
@ 2006-07-24 20:43 ` Bob Wilson
2006-07-27 21:33 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Bob Wilson @ 2006-07-24 20:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Daniel Jacobowitz
Daniel Jacobowitz wrote:
> On Wed, Jul 19, 2006 at 01:33:34PM -0700, Bob Wilson wrote:
>> 2006-07-19 Bob Wilson <bob.wilson@acm.org>
>>
>> * 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.
>>
>
> Thanks, I agree with your logic. This patch is OK. Please don't use
> {A,B} notation in changelogs, though - spell it out.
I don't work on GDB much, so I'm not on the write-after-approval list in the
MAINTAINERS file. If my write access for binutils applies to the gdb directory
(I don't know how that works), I would be happy to apply the patch. Is that OK?
Otherwise, would you apply it for me? Here is the revised changelog:
2006-07-24 Bob Wilson <bob.wilson@acm.org>
* 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_pre_print, quit_pre_print, and
warning_pre_print values.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] print newline after copyright message
2006-07-24 20:43 ` Bob Wilson
@ 2006-07-27 21:33 ` Daniel Jacobowitz
2006-07-27 23:06 ` Bob Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-07-27 21:33 UTC (permalink / raw)
To: Bob Wilson; +Cc: gdb-patches
On Mon, Jul 24, 2006 at 01:43:35PM -0700, Bob Wilson wrote:
> I don't work on GDB much, so I'm not on the write-after-approval list in
> the MAINTAINERS file. If my write access for binutils applies to the gdb
> directory (I don't know how that works), I would be happy to apply the
> patch. Is that OK? Otherwise, would you apply it for me? Here is the
> revised changelog:
You aren't actually in the right group, so I've applied the patch. If
you'd like write access to GDB, though, let me know.
My eye is actually somewhat confused by the new layout, since I was so
used to the old:
drow@caradoc:/space/fsf/x86-64/commit-gdb/gdb% ./gdb =gdb
GNU gdb 6.5.50.20060727-cvs
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
Setting up the environment for debugging gdb.
But I think it's still better. If someone else wants to rearrange the
newlines again later, I'll let them :-)
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] print newline after copyright message
2006-07-27 21:33 ` Daniel Jacobowitz
@ 2006-07-27 23:06 ` Bob Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Bob Wilson @ 2006-07-27 23:06 UTC (permalink / raw)
To: Bob Wilson, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
Daniel Jacobowitz wrote:
> You aren't actually in the right group, so I've applied the patch. If
> you'd like write access to GDB, though, let me know.
Thanks, Daniel. I've applied the following change:
2006-07-27 Bob Wilson <bob.wilson@acm.org>
* MAINTAINERS (Write After Approval): Add myself.
[-- Attachment #2: gdb-maint.diff --]
[-- Type: text/plain, Size: 563 bytes --]
Index: MAINTAINERS
===================================================================
RCS file: /cvs/src/src/gdb/MAINTAINERS,v
retrieving revision 1.348
diff -u -r1.348 MAINTAINERS
--- MAINTAINERS 12 Jul 2006 17:37:24 -0000 1.348
+++ MAINTAINERS 27 Jul 2006 23:01:00 -0000
@@ -546,6 +546,7 @@
Kris Warkentin kewarken@qnx.com
Ulrich Weigand uweigand@de.ibm.com
Nathan Williams nathanw@wasabisystems.com
+Bob Wilson bob.wilson@acm.org
Jim Wilson wilson@specifixinc.com
Elena Zannoni ezannoni@redhat.com
Eli Zaretskii eliz@gnu.org
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-27 23:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-19 20:35 [PATCH] print newline after copyright message Bob Wilson
2006-07-24 20:18 ` Daniel Jacobowitz
2006-07-24 20:43 ` Bob Wilson
2006-07-27 21:33 ` Daniel Jacobowitz
2006-07-27 23:06 ` Bob Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox