Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* New ARI warning Sun Mar  4 01:53:53 UTC 2012
@ 2012-03-04  1:54 GDB Administrator
  2012-03-04  3:29 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: GDB Administrator @ 2012-03-04  1:54 UTC (permalink / raw)
  To: gdb-patches

114a115,123
> gdb/common/agent.c:138: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:138:	  warning ("Error reading helper thread's id in lib");
> gdb/common/agent.c:174: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:174:      warning ("error opening sync socket: %s\n", strerror (errno));
gdb/common/agent.c:174:      warning (', strerror (errno));
> gdb/common/agent.c:174: regression: strerror: Do not use strerror(), instead use safe_strerror()
gdb/common/agent.c:174:      warning ("error opening sync socket: %s\n", strerror (errno));
gdb/common/agent.c:174:      warning (', strerror (errno));
> gdb/common/agent.c:183: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:183:      warning ("string overflow allocating socket name\n");
> gdb/common/agent.c:191: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:191:      warning ("error connecting sync socket (%s): %s. "
> gdb/common/agent.c:193: regression: strerror: Do not use strerror(), instead use safe_strerror()
gdb/common/agent.c:193:	       path, strerror (errno));
> gdb/common/agent.c:227: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:227:      warning ("unable to write");
> gdb/common/agent.c:313: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:313:	  warning ("Error reading command response");
> gdb/common/agent.c:345: gettext: _ markup: All messages should be marked up with _.
gdb/common/agent.c:345:	warning ("Error reading capability of agent");
784a794
> gdb/remote.c:10757: code: sprintf: Do not use sprintf, instead use xsnprintf or xstrprintf
gdb/remote.c:10757:      sprintf (rs->buf, ', use);


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

* Re: New ARI warning Sun Mar  4 01:53:53 UTC 2012
  2012-03-04  1:54 New ARI warning Sun Mar 4 01:53:53 UTC 2012 GDB Administrator
@ 2012-03-04  3:29 ` Yao Qi
  2012-03-07 16:09   ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2012-03-04  3:29 UTC (permalink / raw)
  To: gdb-patches

On 03/04/2012 09:53 AM, GDB Administrator wrote:
> 114a115,123
>> gdb/common/agent.c:138: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:138:	  warning ("Error reading helper thread's id in lib");
>> gdb/common/agent.c:174: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:174:      warning ("error opening sync socket: %s\n", strerror (errno));

>> gdb/common/agent.c:183: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:183:      warning ("string overflow allocating socket name\n");
>> gdb/common/agent.c:191: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:191:      warning ("error connecting sync socket (%s): %s. "

>> gdb/common/agent.c:227: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:227:      warning ("unable to write");
>> gdb/common/agent.c:313: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:313:	  warning ("Error reading command response");
>> gdb/common/agent.c:345: gettext: _ markup: All messages should be marked up with _.
> gdb/common/agent.c:345:	warning ("Error reading capability of agent");
> 784a794

The patch below is to add _ marker and remove trailing new line.
Committed as obvious.

>> gdb/remote.c:10757: code: sprintf: Do not use sprintf, instead use xsnprintf or xstrprintf
> gdb/remote.c:10757:      sprintf (rs->buf, ', use);

Looks like sprintf has been widely used in gdb/remote.c, so I'll
give a separate fix.

> gdb/common/agent.c:174:      warning (', strerror (errno));
>> gdb/common/agent.c:174: regression: strerror: Do not use strerror(), instead use safe_strerror()
> gdb/common/agent.c:174:      warning ("error opening sync socket: %s\n", strerror (errno));
> gdb/common/agent.c:174:      warning (', strerror (errno));
>> gdb/common/agent.c:193: regression: strerror: Do not use strerror(), instead use safe_strerror()
> gdb/common/agent.c:193:	       path, strerror (errno));

We don't have a safe_strerror in GDBserver, so I am inclined to wrap
strerror by safe_strerror in GDBserver.

-- 
Yao (齐尧) 

	* common/agent.c (gdb_connect_sync_socket): Add _ markup and
	remove trailing new line.
	(agent_run_command, agent_run_command): Add _ markup.
	(agent_capability_check): Likewise.

Index: gdb/common/agent.c
===================================================================
RCS file: /cvs/src/src/gdb/common/agent.c,v
retrieving revision 1.5
diff -u -p -r1.5 agent.c
--- gdb/common/agent.c	3 Mar 2012 09:51:28 -0000	1.5
+++ gdb/common/agent.c	4 Mar 2012 03:11:47 -0000
@@ -135,7 +135,7 @@ agent_get_helper_thread_id (void)
       else
 	}
     }
 
@@ -171,7 +171,7 @@ gdb_connect_sync_socket (int pid)
   res = fd = socket (PF_UNIX, SOCK_STREAM, 0);
   if (res == -1)
     {
-      warning ("error opening sync socket: %s\n", strerror (errno));
+      warning (_("error opening sync socket: %s"), strerror (errno));
       return -1;
     }
 
@@ -180,7 +180,7 @@ gdb_connect_sync_socket (int pid)
   res = xsnprintf (addr.sun_path, UNIX_PATH_MAX, "%s", path);
   if (res >= UNIX_PATH_MAX)
     {
-      warning ("string overflow allocating socket name\n");
+      warning (_("string overflow allocating socket name"));
       close (fd);
       return -1;
     }
@@ -188,9 +188,9 @@ gdb_connect_sync_socket (int pid)
   res = connect (fd, (struct sockaddr *) &addr, sizeof (addr));
   if (res == -1)
     {
-      warning ("error connecting sync socket (%s): %s. "
-	       "Make sure the directory exists and that it is writable.",
-	       path, strerror (errno));
+      warning (_("error connecting sync socket (%s): %s. "
+		 "Make sure the directory exists and that it is writable."),
+		 path, strerror (errno));
       close (fd);
       return -1;
     }
@@ -224,7 +224,7 @@ agent_run_command (int pid, const char *
 
   if (ret != 0)
     {
-      warning ("unable to write");
+      warning (_("unable to write"));
       return -1;
     }
 
@@ -310,7 +310,7 @@ agent_run_command (int pid, const char *
 			      IPA_CMD_BUF_SIZE))
 #endif
 	{
-	  warning ("Error reading command response");
+	  warning (_("Error reading command response"));
 	  return -1;
 	}
     }
@@ -342,7 +342,7 @@ agent_capability_check (enum agent_capa 
 						     byte_order);
       else
 #endif
-	warning ("Error reading capability of agent");
+	warning (_("Error reading capability of agent"));
     }
   return agent_capability & agent_capa;
 }


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

* Re: New ARI warning Sun Mar  4 01:53:53 UTC 2012
  2012-03-04  3:29 ` Yao Qi
@ 2012-03-07 16:09   ` Joel Brobecker
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Brobecker @ 2012-03-07 16:09 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

Hi Yao,

I wish I had taken the time to answer a little sooner. Sorry about that.
I hope it doesn't give the impression that we're disinterested.

First of all, a big thank you for keeping on eye on the new ARI
regressions, it's always appreciated when one doesn't have to ping
about it.

> >> gdb/remote.c:10757: code: sprintf: Do not use sprintf, instead use xsnprintf or xstrprintf
> > gdb/remote.c:10757:      sprintf (rs->buf, ', use);
> 
> Looks like sprintf has been widely used in gdb/remote.c, so I'll
> give a separate fix.

That would be awesome. This behavior has been expanding just because
we're repeating the current patterns.

> >> gdb/common/agent.c:193: regression: strerror: Do not use strerror(), instead use safe_strerror()
> > gdb/common/agent.c:193:	       path, strerror (errno));
> 
> We don't have a safe_strerror in GDBserver, so I am inclined to wrap
> strerror by safe_strerror in GDBserver.

Not sure I understand what you are proposing here... Pedro is probably
your best reviewer anyway.

I had a look at safe_strerror, just to see what it's about. It's mostly
about not returning NULL, it seems. But the implementation is dependent
on the host (Windows or POSIX), so it could be a pain to move to common.

-- 
Joel


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

end of thread, other threads:[~2012-03-07 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-04  1:54 New ARI warning Sun Mar 4 01:53:53 UTC 2012 GDB Administrator
2012-03-04  3:29 ` Yao Qi
2012-03-07 16:09   ` Joel Brobecker

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