Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* New ARI warning Fri Mar  2 01:56:15 UTC 2012
@ 2012-03-02  1:56 GDB Administrator
  2012-03-02 19:16 ` [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: GDB Administrator @ 2012-03-02  1:56 UTC (permalink / raw)
  To: gdb-patches

506a507
> gdb/mips-linux-nat.c:450: gettext: _ markup: All messages should be marked up with _.
gdb/mips-linux-nat.c:450:	  perror_with_name ("ptrace");
507a509
> gdb/mips-tdep.c:431: comment: GNU/Linux: Do not use 'Linux', instead use 'Linux kernel' or 'GNU/Linux system'; comments should clearly differentiate between the two (this test assumes that word 'Linux' appears on the same line as the word 'GNU' or 'kernel' or a kernel version
gdb/mips-tdep.c:431:/* Names of Linux registers.  */


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-02  1:56 New ARI warning Fri Mar 2 01:56:15 UTC 2012 GDB Administrator
@ 2012-03-02 19:16 ` Joel Brobecker
  2012-03-09  0:42   ` Maciej W. Rozycki
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2012-03-02 19:16 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

Hello,

I checked the following patch in to fix a couple of new ARI violations.
Once again the Linux kernel vs GNU/Linux rule strikes, and once again,
I find that it makes the text harder to read...

gdb/ChangeLog:

        * mips-linux-nat.c (mips_linux_read_description): Add missing i18n
        marker.
        * mips-tdep.c (mips_linux_reg_names): Improve comment to avoid ARI
        violation.

Checked in.

---
 gdb/ChangeLog        |    7 +++++++
 gdb/mips-linux-nat.c |    2 +-
 gdb/mips-tdep.c      |    2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ca22249..2ef9591 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-02  Joel Brobecker  <brobecker@adacore.com>
+
+	* mips-linux-nat.c (mips_linux_read_description): Add missing i18n
+	marker.
+	* mips-tdep.c (mips_linux_reg_names): Improve comment to avoid ARI
+	violation.
+
 2012-03-02  Pedro Alves  <palves@redhat.com>
 
 	* linux-thread-db.c (attach_thread): Avoid in_thread_list call.
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index af472df..b63be2e 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -447,7 +447,7 @@ mips_linux_read_description (struct target_ops *ops)
 	  have_dsp = 0;
 	  break;
 	default:
-	  perror_with_name ("ptrace");
+	  perror_with_name (_("ptrace"));
 	  break;
 	}
     }
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 6c78640..013b07c 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -428,7 +428,7 @@ static const char *mips_irix_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
   "pc", "cause", "bad", "hi", "lo", "fsr", "fir"
 };
 
-/* Names of Linux registers.  */
+/* Names of registers with Linux kernels.  */
 static const char *mips_linux_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
   "sr", "lo", "hi", "bad", "cause", "pc",
   "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
-- 
1.7.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-02 19:16 ` [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c Joel Brobecker
@ 2012-03-09  0:42   ` Maciej W. Rozycki
  2012-03-09  4:11     ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej W. Rozycki @ 2012-03-09  0:42 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Fri, 2 Mar 2012, Joel Brobecker wrote:

> diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
> index af472df..b63be2e 100644
> --- a/gdb/mips-linux-nat.c
> +++ b/gdb/mips-linux-nat.c
> @@ -447,7 +447,7 @@ mips_linux_read_description (struct target_ops *ops)
>  	  have_dsp = 0;
>  	  break;
>  	default:
> -	  perror_with_name ("ptrace");
> +	  perror_with_name (_("ptrace"));
>  	  break;
>  	}
>      }

 Hmm, I'm not sure if "ptrace" can be translated to anything as it's a 
proper name; however if you're in a picky mood, then watch out for 
numerous cases like this:

gdb/event-loop.c:	perror_with_name (("poll"));

including a zillion in gdb/inf-ttrace.c.

  Maciej


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-09  0:42   ` Maciej W. Rozycki
@ 2012-03-09  4:11     ` Joel Brobecker
  2012-03-09  8:16       ` Maciej W. Rozycki
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2012-03-09  4:11 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: gdb-patches

> > -	  perror_with_name ("ptrace");
> > +	  perror_with_name (_("ptrace"));
> >  	  break;
> >  	}
> >      }
> 
>  Hmm, I'm not sure if "ptrace" can be translated to anything as it's a 
> proper name; however if you're in a picky mood, then watch out for 
> numerous cases like this:

Yeah, these are a little silly. One way to make the a little less
silly, perhaps, would be to have a better message... But not worth
spending time over, if you ask me.

-- 
Joel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-09  4:11     ` Joel Brobecker
@ 2012-03-09  8:16       ` Maciej W. Rozycki
  2012-03-09 11:22         ` Pedro Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej W. Rozycki @ 2012-03-09  8:16 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Fri, 9 Mar 2012, Joel Brobecker wrote:

> > > -	  perror_with_name ("ptrace");
> > > +	  perror_with_name (_("ptrace"));
> > >  	  break;
> > >  	}
> > >      }
> > 
> >  Hmm, I'm not sure if "ptrace" can be translated to anything as it's a 
> > proper name; however if you're in a picky mood, then watch out for 
> > numerous cases like this:
> 
> Yeah, these are a little silly. One way to make the a little less
> silly, perhaps, would be to have a better message... But not worth
> spending time over, if you ask me.

 Yes, I can't comment on the others, but this "ptrace" one surely is for 
an "impossible" error condition (system on fire, anyone?), so it doesn't 
really make sense to put a lot of effort into it as perror will already 
have provided some kind of a comprehensive explanation.

 What about the other issue I noted however, i.e.:

gdb/event-loop.c:	perror_with_name (("poll"));

vs expected:

gdb/event-loop.c:	perror_with_name (_("poll"));

(and so on) -- these clearly look like an oversight.

  Maciej


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-09  8:16       ` Maciej W. Rozycki
@ 2012-03-09 11:22         ` Pedro Alves
  2012-03-09 11:29           ` Maciej W. Rozycki
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2012-03-09 11:22 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Joel Brobecker, gdb-patches

On 03/09/2012 08:15 AM, Maciej W. Rozycki wrote:

>  What about the other issue I noted however, i.e.:
> 
> gdb/event-loop.c:	perror_with_name (("poll"));
> 
> vs expected:
> 
> gdb/event-loop.c:	perror_with_name (_("poll"));
> 
> (and so on) -- these clearly look like an oversight.


I don't think so.  I think this is the way to silence the ARI for strings
that should not be translated.  See:

$ grep "((\"" *
ada-lang.c:              printf_unfiltered (("[%d] "), i + first_choice);
ada-lang.c:        error (("%s"), err_msg);
annotate.c:    printf_filtered (("*"));
annotate.c:    printf_filtered (("-"));
annotate.c:      printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
annotate.c:    printf_filtered (("\n\032\032breakpoint %d\n"), num);
annotate.c:    printf_filtered (("\n\032\032catchpoint %d\n"), num);
annotate.c:    printf_filtered (("\n\032\032watchpoint %d\n"), num);
annotate.c:    printf_filtered (("\n\032\032starting\n"));
annotate.c:    printf_filtered (("\n\032\032stopped\n"));
annotate.c:    printf_filtered (("\n\032\032exited %d\n"), exitstatus);
annotate.c:    printf_filtered (("\n\032\032signalled\n"));
annotate.c:    printf_filtered (("\n\032\032signal-name\n"));
annotate.c:    printf_filtered (("\n\032\032signal-name-end\n"));
annotate.c:    printf_filtered (("\n\032\032signal-string\n"));
annotate.c:    printf_filtered (("\n\032\032signal-string-end\n"));
annotate.c:    printf_filtered (("\n\032\032signal\n"));
annotate.c:    printf_filtered (("\n\032\032breakpoints-headers\n"));
annotate.c:    printf_filtered (("\n\032\032field %d\n"), num);
annotate.c:    printf_filtered (("\n\032\032breakpoints-table\n"));
annotate.c:    printf_filtered (("\n\032\032record\n"));
annotate.c:    printf_filtered (("\n\032\032breakpoints-table-end\n"));
annotate.c:      printf_unfiltered (("\n\032\032frames-invalid\n"));
annotate.c:      printf_unfiltered (("\n\032\032new-thread\n"));
annotate.c:      printf_unfiltered (("\n\032\032thread-changed\n"));
annotate.c:      printf_filtered (("\n\032\032field-begin "));
annotate.c:      printf_filtered (("\n"));
annotate.c:    printf_filtered (("\n\032\032field-name-end\n"));
annotate.c:    printf_filtered (("\n\032\032field-value\n"));
annotate.c:    printf_filtered (("\n\032\032field-end\n"));
annotate.c:    printf_filtered (("\n\032\032quit\n"));
annotate.c:    printf_filtered (("\n\032\032error\n"));
annotate.c:      printf_filtered (("\n\032\032value-history-begin %d "), histindex);
annotate.c:      printf_filtered (("\n"));
annotate.c:      printf_filtered (("\n\032\032value-begin "));
annotate.c:      printf_filtered (("\n"));
annotate.c:    printf_filtered (("\n\032\032value-history-value\n"));
annotate.c:    printf_filtered (("\n\032\032value-history-end\n"));
annotate.c:    printf_filtered (("\n\032\032value-end\n"));
annotate.c:    printf_filtered (("\n\032\032display-begin\n"));
annotate.c:    printf_filtered (("\n\032\032display-number-end\n"));
annotate.c:    printf_filtered (("\n\032\032display-format\n"));
annotate.c:    printf_filtered (("\n\032\032display-expression\n"));
annotate.c:    printf_filtered (("\n\032\032display-expression-end\n"));
annotate.c:    printf_filtered (("\n\032\032display-value\n"));
annotate.c:    printf_filtered (("\n\032\032display-end\n"));
annotate.c:    printf_filtered (("\n\032\032arg-begin\n"));
annotate.c:    printf_filtered (("\n\032\032arg-name-end\n"));
annotate.c:      printf_filtered (("\n\032\032arg-value "));
annotate.c:      printf_filtered (("\n"));
annotate.c:    printf_filtered (("\n\032\032arg-end\n"));
annotate.c:    printf_filtered (("\n\032\032source "));
annotate.c:    printf_filtered (("\032\032"));
annotate.c:  printf_filtered (("%s:%d:%d:%s:%s\n"), filename, line, character,
annotate.c:    printf_filtered (("\n\032\032frame-begin %d %s\n"),
annotate.c:    printf_filtered (("\n\032\032function-call\n"));
annotate.c:    printf_filtered (("\n\032\032signal-handler-caller\n"));
annotate.c:    printf_filtered (("\n\032\032frame-address\n"));
annotate.c:    printf_filtered (("\n\032\032frame-address-end\n"));
annotate.c:    printf_filtered (("\n\032\032frame-function-name\n"));
annotate.c:    printf_filtered (("\n\032\032frame-args\n"));
annotate.c:    printf_filtered (("\n\032\032frame-source-begin\n"));
annotate.c:    printf_filtered (("\n\032\032frame-source-file\n"));
annotate.c:    printf_filtered (("\n\032\032frame-source-file-end\n"));
annotate.c:    printf_filtered (("\n\032\032frame-source-line\n"));
annotate.c:    printf_filtered (("\n\032\032frame-source-end\n"));
annotate.c:    printf_filtered (("\n\032\032frame-where\n"));
annotate.c:    printf_filtered (("\n\032\032frame-end\n"));
annotate.c:      printf_filtered (("\n\032\032array-section-begin %d "), idx);
annotate.c:      printf_filtered (("\n"));
annotate.c:    printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
annotate.c:    printf_filtered (("\n\032\032elt-rep-end\n"));
annotate.c:    printf_filtered (("\n\032\032elt\n"));
annotate.c:    printf_filtered (("\n\032\032array-section-end\n"));
bsd-kvm.c:    error (("%s"), errbuf);
bsd-kvm.c:      warning (("%s"), kvm_geterr(core_kd));
bsd-kvm.c:    error (("%s"), kvm_geterr (core_kd));
bsd-kvm.c:    error (("%s"), kvm_geterr (core_kd));
bsd-kvm.c:    error (("%s"), kvm_geterr (core_kd));
bsd-kvm.c:      error (("%s"), kvm_geterr (core_kd));
bsd-kvm.c:    error (("%s"), kvm_geterr (core_kd));
bsd-kvm.c:      error (("%s"), kvm_geterr (core_kd));
bsd-kvm.c:    error (("%s"), kvm_geterr (core_kd));
event-loop.c:   perror_with_name (("poll"));
event-loop.c:       perror_with_name (("select"));
event-top.c:      printf_unfiltered (("\n\032\032post-"));
event-top.c:      printf_unfiltered (("\n"));
fork-child.c:    perror_with_name (("vfork"));
frame.c:        error (("%s"), message);
gdbtypes.c:     printf_filtered (("1"));
gdbtypes.c:     printf_filtered (("0"));
gnu-nat.c:    error (("%s."), safe_strerror (err));
i386fbsd-nat.c:    perror_with_name (("ptrace"));
i386-linux-nat.c:    perror_with_name (("ptrace"));
inf-ptrace.c:    perror_with_name (("ptrace"));
inf-ptrace.c:   perror_with_name (("ptrace"));
inf-ptrace.c:   perror_with_name (("ptrace"));
inf-ptrace.c:    perror_with_name (("ptrace"));
inf-ptrace.c:    perror_with_name (("ptrace"));
inf-ptrace.c:    perror_with_name (("ptrace"));
inf-ptrace.c:    perror_with_name (("ptrace"));
inf-ptrace.c:    perror_with_name (("ptrace"));
inf-ptrace.c:   perror_with_name (("ptrace"));
inf-ptrace.c:       perror_with_name (("waitpid"));
inf-ptrace.c:       perror_with_name (("ptrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace"));
inf-ttrace.c:       perror_with_name (("ttrace"));
inf-ttrace.c:       perror_with_name (("ttrace"));
inf-ttrace.c:       perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:       perror_with_name (("ttrace"));
inf-ttrace.c:       perror_with_name (("ttrace_wait"));
inf-ttrace.c:       perror_with_name (("ttrace"));
inf-ttrace.c:       perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("pipe"));
inf-ttrace.c:      perror_with_name (("pipe"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("write"));
inf-ttrace.c:    perror_with_name (("read"));
inf-ttrace.c:    perror_with_name (("read"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("write"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace"));
inf-ttrace.c:    perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace_wait"));
inf-ttrace.c:           perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace"));
inf-ttrace.c:   perror_with_name (("ttrace_wait"));
inf-ttrace.c:    perror_with_name (("ttrace"));
linux-nat.c:    perror_with_name (("fork"));
linux-nat.c:    perror_with_name (("waitpid"));
linux-thread-db.c:                     (("%s")), thread_db_err_str (err));
source.c:    error (("%s"), msg);
source.c:    error (("%s"), msg);
utils.c:  error (("%s"), message);
utils.c:        printf_filtered (("\n\032\032pre-query\n"));
utils.c:        printf_filtered (("\n\032\032query\n"));
utils.c:    printf_filtered (("\n\032\032post-query\n"));
utils.c:    printf_unfiltered (("\n\032\032pre-prompt-for-continue\n"));
utils.c:    printf_unfiltered (("\n\032\032post-prompt-for-continue\n"));
value.c:      printf_filtered (("$%d = "), i);
value.c:      printf_filtered (("\n"));
value.c:      printf_filtered (("$%s = "), var->name);
value.c:      printf_filtered (("\n"));
windows-nat.c:  warning (("%s"), s);

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-09 11:22         ` Pedro Alves
@ 2012-03-09 11:29           ` Maciej W. Rozycki
  2012-05-22 18:13             ` Maciej W. Rozycki
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej W. Rozycki @ 2012-03-09 11:29 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Joel Brobecker, gdb-patches

On Fri, 9 Mar 2012, Pedro Alves wrote:

> >  What about the other issue I noted however, i.e.:
> > 
> > gdb/event-loop.c:	perror_with_name (("poll"));
> > 
> > vs expected:
> > 
> > gdb/event-loop.c:	perror_with_name (_("poll"));
> > 
> > (and so on) -- these clearly look like an oversight.
> 
> 
> I don't think so.  I think this is the way to silence the ARI for strings
> that should not be translated.  See:

 I didn't know that, thanks.  In this case I think the same should be done 
with the "ptrace" reference in mips-linux-nat.c.  I'll make a patch 
shortly.

  Maciej


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c
  2012-03-09 11:29           ` Maciej W. Rozycki
@ 2012-05-22 18:13             ` Maciej W. Rozycki
  0 siblings, 0 replies; 8+ messages in thread
From: Maciej W. Rozycki @ 2012-05-22 18:13 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Joel Brobecker, gdb-patches

On Fri, 9 Mar 2012, Maciej W. Rozycki wrote:

> > >  What about the other issue I noted however, i.e.:
> > > 
> > > gdb/event-loop.c:	perror_with_name (("poll"));
> > > 
> > > vs expected:
> > > 
> > > gdb/event-loop.c:	perror_with_name (_("poll"));
> > > 
> > > (and so on) -- these clearly look like an oversight.
> > 
> > 
> > I don't think so.  I think this is the way to silence the ARI for strings
> > that should not be translated.  See:
> 
>  I didn't know that, thanks.  In this case I think the same should be done 
> with the "ptrace" reference in mips-linux-nat.c.  I'll make a patch 
> shortly.

 This disappeared from my radar for a while, but came back now, and I have 
decided to go for a more verbose error instead after all.  I have checked 
in this update now.

2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/
	* mips-linux-nat.c (mips_linux_read_description): Use a more
	verbose error message.

  Maciej

gdb-mips-dsp-err.diff
Index: gdb-fsf-trunk-quilt/gdb/mips-linux-nat.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/mips-linux-nat.c	2012-03-29 23:48:44.000000000 +0100
+++ gdb-fsf-trunk-quilt/gdb/mips-linux-nat.c	2012-05-20 14:09:08.325650594 +0100
@@ -447,7 +447,7 @@ mips_linux_read_description (struct targ
 	  have_dsp = 0;
 	  break;
 	default:
-	  perror_with_name (_("ptrace"));
+	  perror_with_name (_("Couldn't check DSP support"));
 	  break;
 	}
     }


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-22 18:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-02  1:56 New ARI warning Fri Mar 2 01:56:15 UTC 2012 GDB Administrator
2012-03-02 19:16 ` [commit] Fix ARI violations in mips-linux-nat.c and mips-tdep.c Joel Brobecker
2012-03-09  0:42   ` Maciej W. Rozycki
2012-03-09  4:11     ` Joel Brobecker
2012-03-09  8:16       ` Maciej W. Rozycki
2012-03-09 11:22         ` Pedro Alves
2012-03-09 11:29           ` Maciej W. Rozycki
2012-05-22 18:13             ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox