Patchwork Remove "\nError: " suffix from nat/fork-inferior.c:trace_start_error warning message

login
register
mail settings
Submitter Sergio Durigan Junior
Date Aug. 30, 2019, 7:51 p.m.
Message ID <20190830195102.8965-1-sergiodj@redhat.com>
Download mbox | patch
Permalink /patch/34361/
State New
Headers show

Comments

Sergio Durigan Junior - Aug. 30, 2019, 7:51 p.m.
Rationale: https://sourceware.org/ml/gdb-patches/2019-08/msg00651.html

This very simple patch removes the "\nError: " suffix from the warning
message printed by nat/fork-inferior.c:trace_start_error.  This proved
to just pollute the screen, causing things like:

  Starting program: /usr/bin/true
  warning: Could not trace the inferior process.
  Error:
  warning: ptrace: Permission denied

This "Error: " string is not useful at all, and can confuse things,
therefore let's just remove it and simplify the resulting messages:

  Starting program: /usr/bin/true
  warning: Could not trace the inferior process.
  warning: ptrace: Permission denied

2019-08-29  Sergio Durigan Junior  <sergiodj@redhat.com>

	* nat/fork-inferior.c (trace_start_error): Remove "\nError: "
	suffix from warning message.
---
 gdb/nat/fork-inferior.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Pedro Alves - Aug. 30, 2019, 7:54 p.m.
On 8/30/19 8:51 PM, Sergio Durigan Junior wrote:
> Rationale: https://sourceware.org/ml/gdb-patches/2019-08/msg00651.html
> 
> This very simple patch removes the "\nError: " suffix from the warning
> message printed by nat/fork-inferior.c:trace_start_error.  This proved
> to just pollute the screen, causing things like:
> 
>   Starting program: /usr/bin/true
>   warning: Could not trace the inferior process.
>   Error:
>   warning: ptrace: Permission denied
> 
> This "Error: " string is not useful at all, and can confuse things,
> therefore let's just remove it and simplify the resulting messages:
> 
>   Starting program: /usr/bin/true
>   warning: Could not trace the inferior process.
>   warning: ptrace: Permission denied
> 
> 2019-08-29  Sergio Durigan Junior  <sergiodj@redhat.com>
> 
> 	* nat/fork-inferior.c (trace_start_error): Remove "\nError: "
> 	suffix from warning message.

OK.

Thanks,
Pedro Alves
Sergio Durigan Junior - Aug. 30, 2019, 9:06 p.m.
On Friday, August 30 2019, Pedro Alves wrote:

> On 8/30/19 8:51 PM, Sergio Durigan Junior wrote:
>> Rationale: https://sourceware.org/ml/gdb-patches/2019-08/msg00651.html
>> 
>> This very simple patch removes the "\nError: " suffix from the warning
>> message printed by nat/fork-inferior.c:trace_start_error.  This proved
>> to just pollute the screen, causing things like:
>> 
>>   Starting program: /usr/bin/true
>>   warning: Could not trace the inferior process.
>>   Error:
>>   warning: ptrace: Permission denied
>> 
>> This "Error: " string is not useful at all, and can confuse things,
>> therefore let's just remove it and simplify the resulting messages:
>> 
>>   Starting program: /usr/bin/true
>>   warning: Could not trace the inferior process.
>>   warning: ptrace: Permission denied
>> 
>> 2019-08-29  Sergio Durigan Junior  <sergiodj@redhat.com>
>> 
>> 	* nat/fork-inferior.c (trace_start_error): Remove "\nError: "
>> 	suffix from warning message.
>
> OK.

Thanks, pushed: 47a536d940d2f2bccfec51539b857da06ebc429e

Patch

diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
index 68b51aa814..355e9bef43 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -580,7 +580,7 @@  trace_start_error (const char *fmt, ...)
   va_list ap;
 
   va_start (ap, fmt);
-  warning ("Could not trace the inferior process.\nError: ");
+  warning ("Could not trace the inferior process.");
   vwarning (fmt, ap);
   va_end (ap);