This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] Prevent source file errors in --batch-silent mode
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 28 Apr 2008 15:44:15 +0100
- Subject: Re: [PATCH] Prevent source file errors in --batch-silent mode
- References: <480CD958.firstname.lastname@example.org>
1 week ping :)
And let's see if I can add it to the tracker properly this time ...
Andrew STUBBS wrote:
The --batch-silent option disables all output on stdout, thus silencing
GDB with no impact on the rest of the source base. However, it does
*not* silence stderr.
Most of the time this is the right thing to do, but it can lead to a
little unnecessary noise.
Specifically, given the following trivial test file:
Compiled with debug info, but with the source file *taken away*, the
debugger will produce an irritating error message if the running program
is interrupted with Ctrl-C:
$ gdb -ex run a.out -batch-silent
3 t.c: No such file or directory.
In this example the user is irritated, but in typical real world
examples the error message refers to some OS source file they've never
heard of (with a scary name like kernel.c), which may lead the user to
think there is a real problem.
The attached patch prevents GDB attempting to print the source reference
when in --batch-silent mode. The only outward evidence of this feature
was the error message, so nothing is lost. If anything it's a little
more efficient now.