public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Replace the remaining uses of strerror with safe_strerror
@ 2019-11-26 19:59 Christian Biesinger via gdb-patches
  2019-11-26 21:11 ` [PATCH v2] " Christian Biesinger via gdb-patches
  2019-12-06 20:06 ` [PATCH] " Pedro Alves
  0 siblings, 2 replies; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-11-26 19:59 UTC (permalink / raw)
  To: gdb-patches; +Cc: Christian Biesinger

To do that, this patch makes IPA compile safe-strerror as well. Because
it doesn't use Gnulib, it calls the Glibc version of strerror_r directly.
As I understand it, IPA only needs to work on Linux, so this should be safe.

Consequently this patch also removes the configure checks for strerror.

Depends on https://sourceware.org/ml/gdb-patches/2019-11/msg00912.html

gdb/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* config.in: Regenerate.
	* configure: Regenerate.
	* gdbsupport/agent.c (gdb_connect_sync_socket): Call
	safe_strerror instead of strerror.
	* gdbsupport/common.m4: Don't check for strerror.
	* gdbsupport/safe-strerror.c: If IN_PROCESS_AGENT is defined,
	call the glibc version of strerror_r.

gdb/gdbserver/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* Makefile.in: Add safe-strerror.c to gdbreplay and IPA.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Don't check for strerror.
	* linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer):
	Call safe_strerror instead of strerror.
	* server.h (strerror): Remove this now-unnecessary declaration.
	* tracepoint.c (init_named_socket): Call safe_strerror instead of
	strerror.
	(gdb_agent_helper_thread): Likewise.
	* utils.c (perror_with_name): Likewise.

Change-Id: I74848f072dcde75cb55c435ef9398dc8f958cd73
---
 gdb/config.in                  |  4 ----
 gdb/configure                  | 12 +-----------
 gdb/gdbserver/Makefile.in      |  2 ++
 gdb/gdbserver/config.in        |  4 ----
 gdb/gdbserver/configure        | 22 +---------------------
 gdb/gdbserver/configure.ac     |  2 +-
 gdb/gdbserver/linux-i386-ipa.c |  4 ++--
 gdb/gdbserver/server.h         |  6 ------
 gdb/gdbserver/tracepoint.c     | 12 ++++++------
 gdb/gdbserver/utils.c          |  2 +-
 gdb/gdbsupport/agent.c         |  4 ++--
 gdb/gdbsupport/common.m4       |  2 +-
 gdb/gdbsupport/safe-strerror.c |  7 +++++++
 13 files changed, 24 insertions(+), 59 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index fc05f154b7..3b8acd3c96 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -114,10 +114,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/configure b/gdb/configure
index 4afd7f9b96..e0cf51455a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13489,17 +13489,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index aba0eea78f..2e93b8c9e9 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -301,6 +301,7 @@ GDBREPLAY_OBS = \
 	gdbsupport/errors.o \
 	gdbsupport/netstuff.o \
 	gdbsupport/print-utils.o \
+	gdbsupport/safe-strerror.o \
 	gdbreplay.o \
 	utils.o \
 	version.o
@@ -427,6 +428,7 @@ IPA_OBJS = \
 	gdbsupport/format-ipa.o \
 	gdbsupport/print-utils-ipa.o \
 	gdbsupport/rsp-low-ipa.o \
+	gdbsupport/safe-strerror-ipa.o \
 	gdbsupport/tdesc-ipa.o \
 	regcache-ipa.o \
 	remote-utils-ipa.o \
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 0bce18d2a0..a659877072 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -51,10 +51,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index d1d00a4cfe..beb7618ab3 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -6835,17 +6835,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
@@ -7531,16 +7521,6 @@ _ACEOF
 
 
 
-ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
 ac_fn_c_check_decl "$LINENO" "perror" "ac_cv_have_decl_perror" "$ac_includes_default"
 if test "x$ac_cv_have_decl_perror" = xyes; then :
   ac_have_decl=1
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 07c9bd7fa7..4a6d88ebd1 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -158,7 +158,7 @@ LIBS="$old_LIBS"
 
 libiberty_INIT
 
-AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
+AC_CHECK_DECLS([perror, vasprintf, vsnprintf])
 
 AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
 
diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c
index 2e3d1ac7fe..4bbc1b5f51 100644
--- a/gdb/gdbserver/linux-i386-ipa.c
+++ b/gdb/gdbserver/linux-i386-ipa.c
@@ -210,7 +210,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
   if (!f)
     {    
       snprintf (buf, sizeof (buf), "mmap_min_addr open failed: %s",
-		strerror (errno));
+		safe_strerror (errno));
       set_trampoline_buffer_space (0, 0, buf);
       return;
     }
@@ -233,7 +233,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
       else
 	{
 	  snprintf (buf, IPA_BUFSIZ, "low-64K-buffer mmap() failed: %s",
-		    strerror (errno));
+		    safe_strerror (errno));
 	  set_trampoline_buffer_space (0, 0, buf);
 	}
     }
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index e01c4f146e..3326159dfe 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -29,12 +29,6 @@ gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
 
 #include "gdbsupport/version.h"
 
-#if !HAVE_DECL_STRERROR
-#ifndef strerror
-extern char *strerror (int);	/* X3.159-1989  4.11.6.2 */
-#endif
-#endif
-
 #if !HAVE_DECL_PERROR
 #ifndef perror
 extern void perror (const char *);
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 2bd75dfb4a..9f8a49174c 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -6879,7 +6879,7 @@ init_named_socket (const char *name)
   result = fd = socket (PF_UNIX, SOCK_STREAM, 0);
   if (result == -1)
     {
-      warning ("socket creation failed: %s", strerror (errno));
+      warning ("socket creation failed: %s", safe_strerror (errno));
       return -1;
     }
 
@@ -6895,7 +6895,7 @@ init_named_socket (const char *name)
       result = unlink (name);
       if (result == -1)
 	{
-	  warning ("unlink failed: %s", strerror (errno));
+	  warning ("unlink failed: %s", safe_strerror (errno));
 	  close (fd);
 	  return -1;
 	}
@@ -6905,7 +6905,7 @@ init_named_socket (const char *name)
   result = bind (fd, (struct sockaddr *) &addr, sizeof (addr));
   if (result == -1)
     {
-      warning ("bind failed: %s", strerror (errno));
+      warning ("bind failed: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -6913,7 +6913,7 @@ init_named_socket (const char *name)
   result = listen (fd, 1);
   if (result == -1)
     {
-      warning ("listen: %s", strerror (errno));
+      warning ("listen: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -7219,7 +7219,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (fd < 0)
 	    {
 	      warning ("Accept returned %d, error: %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      break;
 	    }
 
@@ -7231,7 +7231,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (ret == -1)
 	    {
 	      warning ("reading socket (fd=%d) failed with %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      close (fd);
 	      break;
 	    }
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 6a0e7a7a0f..b72dd0ec2b 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -47,7 +47,7 @@ perror_with_name (const char *string)
   const char *err;
   char *combined;
 
-  err = strerror (errno);
+  err = safe_strerror (errno);
   if (err == NULL)
     err = "unknown error";
 
diff --git a/gdb/gdbsupport/agent.c b/gdb/gdbsupport/agent.c
index 6d55f586b8..50e9500ffc 100644
--- a/gdb/gdbsupport/agent.c
+++ b/gdb/gdbsupport/agent.c
@@ -149,7 +149,7 @@ gdb_connect_sync_socket (int pid)
   res = fd = gdb_socket_cloexec (PF_UNIX, SOCK_STREAM, 0);
   if (res == -1)
     {
-      warning (_("error opening sync socket: %s"), strerror (errno));
+      warning (_("error opening sync socket: %s"), safe_strerror (errno));
       return -1;
     }
 
@@ -168,7 +168,7 @@ gdb_connect_sync_socket (int pid)
     {
       warning (_("error connecting sync socket (%s): %s. "
 		 "Make sure the directory exists and that it is writable."),
-		 path, strerror (errno));
+		 path, safe_strerror (errno));
       close (fd);
       return -1;
     }
diff --git a/gdb/gdbsupport/common.m4 b/gdb/gdbsupport/common.m4
index 471d7056f7..0770977c4e 100644
--- a/gdb/gdbsupport/common.m4
+++ b/gdb/gdbsupport/common.m4
@@ -35,7 +35,7 @@ AC_DEFUN([GDB_AC_COMMON], [
   AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair sigaction \
 		  sigprocmask])
 
-  AC_CHECK_DECLS([strerror, strstr])
+  AC_CHECK_DECLS([strstr])
 
   dnl Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't
   dnl do since sigsetjmp might only be defined as a macro.
diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
index c37db579f7..724a1d24db 100644
--- a/gdb/gdbsupport/safe-strerror.c
+++ b/gdb/gdbsupport/safe-strerror.c
@@ -27,11 +27,18 @@ safe_strerror (int errnum)
 {
   static thread_local char buf[1024];
 
+#ifdef IN_PROCESS_AGENT
+  /* IPA does not use Gnulib, but only supports Linux, so we can safely
+     call the GNU version of strerror_r here.  It is documented not to
+     return NULL.  */
+  return strerror_r (errnum, buf, sizeof (buf));
+#else
   /* Assign the return value to an int, so we get an error if we accidentally
      get the wrong version of this function (glibc has two of them...).  */
   int ret = strerror_r (errnum, buf, sizeof (buf));
   if (ret == 0)
     return buf;
+#endif
 
   xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
   return buf;
-- 
2.24.0.432.g9d3f5f5b63-goog

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

* [PATCH v2] Replace the remaining uses of strerror with safe_strerror
  2019-11-26 19:59 [PATCH] Replace the remaining uses of strerror with safe_strerror Christian Biesinger via gdb-patches
@ 2019-11-26 21:11 ` Christian Biesinger via gdb-patches
  2019-12-06 20:06 ` [PATCH] " Pedro Alves
  1 sibling, 0 replies; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-11-26 21:11 UTC (permalink / raw)
  To: gdb-patches; +Cc: Christian Biesinger

[Now still using the Gnulib header. However, because IPA does not link
against Gnulib currently, I still have to use a different signature in
safe-strerror.c]

To do that, this patch makes IPA compile safe-strerror as well. Because
it doesn't use Gnulib, it calls the Glibc version of strerror_r directly.
As I understand it, IPA only needs to work on Linux, so this should be safe.

Consequently this patch also removes the configure checks for strerror.

Depends on https://sourceware.org/ml/gdb-patches/2019-11/msg00912.html

gdb/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* config.in: Regenerate.
	* configure: Regenerate.
	* gdbsupport/agent.c (gdb_connect_sync_socket): Call
	safe_strerror instead of strerror.
	* gdbsupport/common.m4: Don't check for strerror.
	* gdbsupport/safe-strerror.c: If IN_PROCESS_AGENT is defined,
	call the glibc version of strerror_r.

gdb/gdbserver/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change
	UNDO_GNULIB_CFLAGS to undo strerror_r instead of strerror.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Don't check for strerror.
	* linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer):
	Call safe_strerror instead of strerror.
	* server.h (strerror): Remove this now-unnecessary declaration.
	* tracepoint.c (init_named_socket): Call safe_strerror instead of
	strerror.
	(gdb_agent_helper_thread): Likewise.
	* utils.c (perror_with_name): Likewise.

Change-Id: I74848f072dcde75cb55c435ef9398dc8f958cd73
---
 gdb/config.in                  |  4 ----
 gdb/configure                  | 12 +-----------
 gdb/gdbserver/Makefile.in      |  4 +++-
 gdb/gdbserver/config.in        |  4 ----
 gdb/gdbserver/configure        | 22 +---------------------
 gdb/gdbserver/configure.ac     |  2 +-
 gdb/gdbserver/linux-i386-ipa.c |  4 ++--
 gdb/gdbserver/server.h         |  6 ------
 gdb/gdbserver/tracepoint.c     | 12 ++++++------
 gdb/gdbserver/utils.c          |  2 +-
 gdb/gdbsupport/agent.c         |  4 ++--
 gdb/gdbsupport/common.m4       |  2 +-
 gdb/gdbsupport/safe-strerror.c |  7 +++++++
 13 files changed, 25 insertions(+), 60 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index fc05f154b7..3b8acd3c96 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -114,10 +114,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/configure b/gdb/configure
index 4afd7f9b96..e0cf51455a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13489,17 +13489,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 16012dddcb..e6ca9168b0 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -301,6 +301,7 @@ GDBREPLAY_OBS = \
 	gdbsupport/errors.o \
 	gdbsupport/netstuff.o \
 	gdbsupport/print-utils.o \
+	gdbsupport/safe-strerror.o \
 	gdbreplay.o \
 	utils.o \
 	version.o
@@ -427,6 +428,7 @@ IPA_OBJS = \
 	gdbsupport/format-ipa.o \
 	gdbsupport/print-utils-ipa.o \
 	gdbsupport/rsp-low-ipa.o \
+	gdbsupport/safe-strerror-ipa.o \
 	gdbsupport/tdesc-ipa.o \
 	regcache-ipa.o \
 	remote-utils-ipa.o \
@@ -554,7 +556,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 # Undo gnulib replacements for the IPA shared library build.
 # The gnulib headers are still needed, but gnulib is not linked
 # into the IPA lib so replacement apis don't work.
-UNDO_GNULIB_CFLAGS = -Drpl_strerror=strerror
+UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
 
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 0bce18d2a0..a659877072 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -51,10 +51,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index d1d00a4cfe..beb7618ab3 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -6835,17 +6835,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
@@ -7531,16 +7521,6 @@ _ACEOF
 
 
 
-ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
 ac_fn_c_check_decl "$LINENO" "perror" "ac_cv_have_decl_perror" "$ac_includes_default"
 if test "x$ac_cv_have_decl_perror" = xyes; then :
   ac_have_decl=1
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 07c9bd7fa7..4a6d88ebd1 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -158,7 +158,7 @@ LIBS="$old_LIBS"
 
 libiberty_INIT
 
-AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
+AC_CHECK_DECLS([perror, vasprintf, vsnprintf])
 
 AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
 
diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c
index 2e3d1ac7fe..4bbc1b5f51 100644
--- a/gdb/gdbserver/linux-i386-ipa.c
+++ b/gdb/gdbserver/linux-i386-ipa.c
@@ -210,7 +210,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
   if (!f)
     {    
       snprintf (buf, sizeof (buf), "mmap_min_addr open failed: %s",
-		strerror (errno));
+		safe_strerror (errno));
       set_trampoline_buffer_space (0, 0, buf);
       return;
     }
@@ -233,7 +233,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
       else
 	{
 	  snprintf (buf, IPA_BUFSIZ, "low-64K-buffer mmap() failed: %s",
-		    strerror (errno));
+		    safe_strerror (errno));
 	  set_trampoline_buffer_space (0, 0, buf);
 	}
     }
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index e01c4f146e..3326159dfe 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -29,12 +29,6 @@ gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
 
 #include "gdbsupport/version.h"
 
-#if !HAVE_DECL_STRERROR
-#ifndef strerror
-extern char *strerror (int);	/* X3.159-1989  4.11.6.2 */
-#endif
-#endif
-
 #if !HAVE_DECL_PERROR
 #ifndef perror
 extern void perror (const char *);
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 2bd75dfb4a..9f8a49174c 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -6879,7 +6879,7 @@ init_named_socket (const char *name)
   result = fd = socket (PF_UNIX, SOCK_STREAM, 0);
   if (result == -1)
     {
-      warning ("socket creation failed: %s", strerror (errno));
+      warning ("socket creation failed: %s", safe_strerror (errno));
       return -1;
     }
 
@@ -6895,7 +6895,7 @@ init_named_socket (const char *name)
       result = unlink (name);
       if (result == -1)
 	{
-	  warning ("unlink failed: %s", strerror (errno));
+	  warning ("unlink failed: %s", safe_strerror (errno));
 	  close (fd);
 	  return -1;
 	}
@@ -6905,7 +6905,7 @@ init_named_socket (const char *name)
   result = bind (fd, (struct sockaddr *) &addr, sizeof (addr));
   if (result == -1)
     {
-      warning ("bind failed: %s", strerror (errno));
+      warning ("bind failed: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -6913,7 +6913,7 @@ init_named_socket (const char *name)
   result = listen (fd, 1);
   if (result == -1)
     {
-      warning ("listen: %s", strerror (errno));
+      warning ("listen: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -7219,7 +7219,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (fd < 0)
 	    {
 	      warning ("Accept returned %d, error: %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      break;
 	    }
 
@@ -7231,7 +7231,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (ret == -1)
 	    {
 	      warning ("reading socket (fd=%d) failed with %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      close (fd);
 	      break;
 	    }
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 6a0e7a7a0f..b72dd0ec2b 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -47,7 +47,7 @@ perror_with_name (const char *string)
   const char *err;
   char *combined;
 
-  err = strerror (errno);
+  err = safe_strerror (errno);
   if (err == NULL)
     err = "unknown error";
 
diff --git a/gdb/gdbsupport/agent.c b/gdb/gdbsupport/agent.c
index 6d55f586b8..50e9500ffc 100644
--- a/gdb/gdbsupport/agent.c
+++ b/gdb/gdbsupport/agent.c
@@ -149,7 +149,7 @@ gdb_connect_sync_socket (int pid)
   res = fd = gdb_socket_cloexec (PF_UNIX, SOCK_STREAM, 0);
   if (res == -1)
     {
-      warning (_("error opening sync socket: %s"), strerror (errno));
+      warning (_("error opening sync socket: %s"), safe_strerror (errno));
       return -1;
     }
 
@@ -168,7 +168,7 @@ gdb_connect_sync_socket (int pid)
     {
       warning (_("error connecting sync socket (%s): %s. "
 		 "Make sure the directory exists and that it is writable."),
-		 path, strerror (errno));
+		 path, safe_strerror (errno));
       close (fd);
       return -1;
     }
diff --git a/gdb/gdbsupport/common.m4 b/gdb/gdbsupport/common.m4
index 471d7056f7..0770977c4e 100644
--- a/gdb/gdbsupport/common.m4
+++ b/gdb/gdbsupport/common.m4
@@ -35,7 +35,7 @@ AC_DEFUN([GDB_AC_COMMON], [
   AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair sigaction \
 		  sigprocmask])
 
-  AC_CHECK_DECLS([strerror, strstr])
+  AC_CHECK_DECLS([strstr])
 
   dnl Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't
   dnl do since sigsetjmp might only be defined as a macro.
diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
index c37db579f7..724a1d24db 100644
--- a/gdb/gdbsupport/safe-strerror.c
+++ b/gdb/gdbsupport/safe-strerror.c
@@ -27,11 +27,18 @@ safe_strerror (int errnum)
 {
   static thread_local char buf[1024];
 
+#ifdef IN_PROCESS_AGENT
+  /* IPA does not use Gnulib, but only supports Linux, so we can safely
+     call the GNU version of strerror_r here.  It is documented not to
+     return NULL.  */
+  return strerror_r (errnum, buf, sizeof (buf));
+#else
   /* Assign the return value to an int, so we get an error if we accidentally
      get the wrong version of this function (glibc has two of them...).  */
   int ret = strerror_r (errnum, buf, sizeof (buf));
   if (ret == 0)
     return buf;
+#endif
 
   xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
   return buf;
-- 
2.24.0.432.g9d3f5f5b63-goog

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

* Re: [PATCH] Replace the remaining uses of strerror with safe_strerror
  2019-11-26 19:59 [PATCH] Replace the remaining uses of strerror with safe_strerror Christian Biesinger via gdb-patches
  2019-11-26 21:11 ` [PATCH v2] " Christian Biesinger via gdb-patches
@ 2019-12-06 20:06 ` Pedro Alves
  2019-12-06 20:36   ` Christian Biesinger via gdb-patches
  1 sibling, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2019-12-06 20:06 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches

On 11/26/19 7:59 PM, Christian Biesinger via gdb-patches wrote:

> index c37db579f7..724a1d24db 100644
> --- a/gdb/gdbsupport/safe-strerror.c
> +++ b/gdb/gdbsupport/safe-strerror.c
> @@ -27,11 +27,18 @@ safe_strerror (int errnum)
>  {
>    static thread_local char buf[1024];
>  
> +#ifdef IN_PROCESS_AGENT
> +  /* IPA does not use Gnulib, but only supports Linux, so we can safely
> +     call the GNU version of strerror_r here.  It is documented not to
> +     return NULL.  */
> +  return strerror_r (errnum, buf, sizeof (buf));

GDBserver and (I assume) the IPA can be built with other C runtimes on Linux,
like musl and others.  Do you know how musl behaves?

Thanks,
Pedro Alves

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

* Re: [PATCH] Replace the remaining uses of strerror with safe_strerror
  2019-12-06 20:06 ` [PATCH] " Pedro Alves
@ 2019-12-06 20:36   ` Christian Biesinger via gdb-patches
  2019-12-06 20:44     ` [PATCH v3] " Christian Biesinger via gdb-patches
  2019-12-06 21:46     ` [PATCH] " Pedro Alves
  0 siblings, 2 replies; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-06 20:36 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Dec 6, 2019 at 2:06 PM Pedro Alves <palves@redhat.com> wrote:
>
> On 11/26/19 7:59 PM, Christian Biesinger via gdb-patches wrote:
>
> > index c37db579f7..724a1d24db 100644
> > --- a/gdb/gdbsupport/safe-strerror.c
> > +++ b/gdb/gdbsupport/safe-strerror.c
> > @@ -27,11 +27,18 @@ safe_strerror (int errnum)
> >  {
> >    static thread_local char buf[1024];
> >
> > +#ifdef IN_PROCESS_AGENT
> > +  /* IPA does not use Gnulib, but only supports Linux, so we can safely
> > +     call the GNU version of strerror_r here.  It is documented not to
> > +     return NULL.  */
> > +  return strerror_r (errnum, buf, sizeof (buf));
>
> GDBserver and (I assume) the IPA can be built with other C runtimes on Linux,
> like musl and others.  Do you know how musl behaves?

Oof, looks like they return int :(
http://git.musl-libc.org/cgit/musl/tree/src/string/strerror_r.c

I guess I'll change to #if defined(IN_PROCESS_AGENT) && defined(__GLIBC__)?

Christian

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

* [PATCH v3] Replace the remaining uses of strerror with safe_strerror
  2019-12-06 20:36   ` Christian Biesinger via gdb-patches
@ 2019-12-06 20:44     ` Christian Biesinger via gdb-patches
  2019-12-06 21:46     ` [PATCH] " Pedro Alves
  1 sibling, 0 replies; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-06 20:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: Christian Biesinger

[Should now work for musl, though I have no easy way to test.]

To do that, this patch makes IPA compile safe-strerror as well. Because
it doesn't use Gnulib, it calls the Glibc version of strerror_r directly.
As I understand it, IPA only needs to work on Linux, so this should be safe.

Consequently this patch also removes the configure checks for strerror.

Depends on https://sourceware.org/ml/gdb-patches/2019-11/msg00912.html

gdb/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* config.in: Regenerate.
	* configure: Regenerate.
	* gdbsupport/agent.c (gdb_connect_sync_socket): Call
	safe_strerror instead of strerror.
	* gdbsupport/common.m4: Don't check for strerror.
	* gdbsupport/safe-strerror.c: If IN_PROCESS_AGENT is defined,
	call the glibc version of strerror_r.

gdb/gdbserver/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change
	UNDO_GNULIB_CFLAGS to undo strerror_r instead of strerror.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Don't check for strerror.
	* linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer):
	Call safe_strerror instead of strerror.
	* server.h (strerror): Remove this now-unnecessary declaration.
	* tracepoint.c (init_named_socket): Call safe_strerror instead of
	strerror.
	(gdb_agent_helper_thread): Likewise.
	* utils.c (perror_with_name): Likewise.

Change-Id: I74848f072dcde75cb55c435ef9398dc8f958cd73
---
 gdb/config.in                  |  4 ----
 gdb/configure                  | 12 +-----------
 gdb/gdbserver/Makefile.in      |  4 +++-
 gdb/gdbserver/config.in        |  4 ----
 gdb/gdbserver/configure        | 22 +---------------------
 gdb/gdbserver/configure.ac     |  2 +-
 gdb/gdbserver/linux-i386-ipa.c |  4 ++--
 gdb/gdbserver/server.h         |  6 ------
 gdb/gdbserver/tracepoint.c     | 12 ++++++------
 gdb/gdbserver/utils.c          |  2 +-
 gdb/gdbsupport/agent.c         |  4 ++--
 gdb/gdbsupport/common.m4       |  2 +-
 gdb/gdbsupport/safe-strerror.c |  8 ++++++++
 13 files changed, 26 insertions(+), 60 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index 1caf76481b..cb886ba8e1 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -117,10 +117,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/configure b/gdb/configure
index 6b64619df7..324eb50944 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13630,17 +13630,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index e79d24f96f..10e004039f 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -304,6 +304,7 @@ GDBREPLAY_OBS = \
 	gdbsupport/errors.o \
 	gdbsupport/netstuff.o \
 	gdbsupport/print-utils.o \
+	gdbsupport/safe-strerror.o \
 	gdbreplay.o \
 	utils.o \
 	version.o
@@ -430,6 +431,7 @@ IPA_OBJS = \
 	gdbsupport/format-ipa.o \
 	gdbsupport/print-utils-ipa.o \
 	gdbsupport/rsp-low-ipa.o \
+	gdbsupport/safe-strerror-ipa.o \
 	gdbsupport/tdesc-ipa.o \
 	regcache-ipa.o \
 	remote-utils-ipa.o \
@@ -557,7 +559,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 # Undo gnulib replacements for the IPA shared library build.
 # The gnulib headers are still needed, but gnulib is not linked
 # into the IPA lib so replacement apis don't work.
-UNDO_GNULIB_CFLAGS = -Drpl_strerror=strerror
+UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
 
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 14cf7099e3..b1e58a3941 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -54,10 +54,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index da17f8cb2c..ccffde80ed 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -7022,17 +7022,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
@@ -8427,16 +8417,6 @@ _ACEOF
 
 
 
-ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
 ac_fn_c_check_decl "$LINENO" "perror" "ac_cv_have_decl_perror" "$ac_includes_default"
 if test "x$ac_cv_have_decl_perror" = xyes; then :
   ac_have_decl=1
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 07c9bd7fa7..4a6d88ebd1 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -158,7 +158,7 @@ LIBS="$old_LIBS"
 
 libiberty_INIT
 
-AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
+AC_CHECK_DECLS([perror, vasprintf, vsnprintf])
 
 AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
 
diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c
index 2e3d1ac7fe..4bbc1b5f51 100644
--- a/gdb/gdbserver/linux-i386-ipa.c
+++ b/gdb/gdbserver/linux-i386-ipa.c
@@ -210,7 +210,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
   if (!f)
     {    
       snprintf (buf, sizeof (buf), "mmap_min_addr open failed: %s",
-		strerror (errno));
+		safe_strerror (errno));
       set_trampoline_buffer_space (0, 0, buf);
       return;
     }
@@ -233,7 +233,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
       else
 	{
 	  snprintf (buf, IPA_BUFSIZ, "low-64K-buffer mmap() failed: %s",
-		    strerror (errno));
+		    safe_strerror (errno));
 	  set_trampoline_buffer_space (0, 0, buf);
 	}
     }
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index e01c4f146e..3326159dfe 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -29,12 +29,6 @@ gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
 
 #include "gdbsupport/version.h"
 
-#if !HAVE_DECL_STRERROR
-#ifndef strerror
-extern char *strerror (int);	/* X3.159-1989  4.11.6.2 */
-#endif
-#endif
-
 #if !HAVE_DECL_PERROR
 #ifndef perror
 extern void perror (const char *);
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 2bd75dfb4a..9f8a49174c 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -6879,7 +6879,7 @@ init_named_socket (const char *name)
   result = fd = socket (PF_UNIX, SOCK_STREAM, 0);
   if (result == -1)
     {
-      warning ("socket creation failed: %s", strerror (errno));
+      warning ("socket creation failed: %s", safe_strerror (errno));
       return -1;
     }
 
@@ -6895,7 +6895,7 @@ init_named_socket (const char *name)
       result = unlink (name);
       if (result == -1)
 	{
-	  warning ("unlink failed: %s", strerror (errno));
+	  warning ("unlink failed: %s", safe_strerror (errno));
 	  close (fd);
 	  return -1;
 	}
@@ -6905,7 +6905,7 @@ init_named_socket (const char *name)
   result = bind (fd, (struct sockaddr *) &addr, sizeof (addr));
   if (result == -1)
     {
-      warning ("bind failed: %s", strerror (errno));
+      warning ("bind failed: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -6913,7 +6913,7 @@ init_named_socket (const char *name)
   result = listen (fd, 1);
   if (result == -1)
     {
-      warning ("listen: %s", strerror (errno));
+      warning ("listen: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -7219,7 +7219,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (fd < 0)
 	    {
 	      warning ("Accept returned %d, error: %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      break;
 	    }
 
@@ -7231,7 +7231,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (ret == -1)
 	    {
 	      warning ("reading socket (fd=%d) failed with %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      close (fd);
 	      break;
 	    }
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 6a0e7a7a0f..b72dd0ec2b 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -47,7 +47,7 @@ perror_with_name (const char *string)
   const char *err;
   char *combined;
 
-  err = strerror (errno);
+  err = safe_strerror (errno);
   if (err == NULL)
     err = "unknown error";
 
diff --git a/gdb/gdbsupport/agent.c b/gdb/gdbsupport/agent.c
index 6d55f586b8..50e9500ffc 100644
--- a/gdb/gdbsupport/agent.c
+++ b/gdb/gdbsupport/agent.c
@@ -149,7 +149,7 @@ gdb_connect_sync_socket (int pid)
   res = fd = gdb_socket_cloexec (PF_UNIX, SOCK_STREAM, 0);
   if (res == -1)
     {
-      warning (_("error opening sync socket: %s"), strerror (errno));
+      warning (_("error opening sync socket: %s"), safe_strerror (errno));
       return -1;
     }
 
@@ -168,7 +168,7 @@ gdb_connect_sync_socket (int pid)
     {
       warning (_("error connecting sync socket (%s): %s. "
 		 "Make sure the directory exists and that it is writable."),
-		 path, strerror (errno));
+		 path, safe_strerror (errno));
       close (fd);
       return -1;
     }
diff --git a/gdb/gdbsupport/common.m4 b/gdb/gdbsupport/common.m4
index 4f2bb5218d..c61753fb8e 100644
--- a/gdb/gdbsupport/common.m4
+++ b/gdb/gdbsupport/common.m4
@@ -35,7 +35,7 @@ AC_DEFUN([GDB_AC_COMMON], [
   AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair sigaction \
 		  sigprocmask])
 
-  AC_CHECK_DECLS([strerror, strstr])
+  AC_CHECK_DECLS([strstr])
 
   # Check for std::thread.  This does not work on some platforms, like
   # mingw and DJGPP.
diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
index c37db579f7..6d30e4633b 100644
--- a/gdb/gdbsupport/safe-strerror.c
+++ b/gdb/gdbsupport/safe-strerror.c
@@ -27,11 +27,19 @@ safe_strerror (int errnum)
 {
   static thread_local char buf[1024];
 
+#if defined(IN_PROCESS_AGENT) && defined(__GLIBC__)
+  /* IPA does not use Gnulib, but only supports Linux, so we can safely
+     call the GNU version of strerror_r here if using glibc.  It is documented
+     not to return NULL.  musl uses the portable signature, so should
+     use the other branch of the #if.  */
+  return strerror_r (errnum, buf, sizeof (buf));
+#else
   /* Assign the return value to an int, so we get an error if we accidentally
      get the wrong version of this function (glibc has two of them...).  */
   int ret = strerror_r (errnum, buf, sizeof (buf));
   if (ret == 0)
     return buf;
+#endif
 
   xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
   return buf;
-- 
2.24.0.393.g34dc348eaf-goog

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

* Re: [PATCH] Replace the remaining uses of strerror with safe_strerror
  2019-12-06 20:36   ` Christian Biesinger via gdb-patches
  2019-12-06 20:44     ` [PATCH v3] " Christian Biesinger via gdb-patches
@ 2019-12-06 21:46     ` Pedro Alves
  2019-12-09 19:11       ` Christian Biesinger via gdb-patches
  1 sibling, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2019-12-06 21:46 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: gdb-patches

On 12/6/19 8:36 PM, Christian Biesinger wrote:
> On Fri, Dec 6, 2019 at 2:06 PM Pedro Alves <palves@redhat.com> wrote:

>> GDBserver and (I assume) the IPA can be built with other C runtimes on Linux,
>> like musl and others.  Do you know how musl behaves?
> 
> Oof, looks like they return int :(
> http://git.musl-libc.org/cgit/musl/tree/src/string/strerror_r.c
> 
> I guess I'll change to #if defined(IN_PROCESS_AGENT) && defined(__GLIBC__)?
> 

Crazy thought --- use C++ overload resolution to pick the right thing
automatically:

 /* Called if we have a XSI-compliant strerror_r.  */
 static char *select_strerror_r (int, char *buf) { return buf; }

 /* Called if we have a GNU strerror_r.  */
 static char *select_strerror_r (char *res, char *) { return res; }

 #ifdef IN_PROCESS_AGENT
    return select_strerror_r (strerror_r (errnum, buf, buflen), buf);
 #else ...

Thanks,
Pedro Alves

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

* Re: [PATCH] Replace the remaining uses of strerror with safe_strerror
  2019-12-06 21:46     ` [PATCH] " Pedro Alves
@ 2019-12-09 19:11       ` Christian Biesinger via gdb-patches
  2019-12-09 19:13         ` [PATCH v3] " Christian Biesinger via gdb-patches
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-09 19:11 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Dec 6, 2019 at 4:46 PM Pedro Alves <palves@redhat.com> wrote:
>
> On 12/6/19 8:36 PM, Christian Biesinger wrote:
> > On Fri, Dec 6, 2019 at 2:06 PM Pedro Alves <palves@redhat.com> wrote:
>
> >> GDBserver and (I assume) the IPA can be built with other C runtimes on Linux,
> >> like musl and others.  Do you know how musl behaves?
> >
> > Oof, looks like they return int :(
> > http://git.musl-libc.org/cgit/musl/tree/src/string/strerror_r.c
> >
> > I guess I'll change to #if defined(IN_PROCESS_AGENT) && defined(__GLIBC__)?
> >
>
> Crazy thought --- use C++ overload resolution to pick the right thing
> automatically:
>
>  /* Called if we have a XSI-compliant strerror_r.  */
>  static char *select_strerror_r (int, char *buf) { return buf; }
>
>  /* Called if we have a GNU strerror_r.  */
>  static char *select_strerror_r (char *res, char *) { return res; }
>
>  #ifdef IN_PROCESS_AGENT
>     return select_strerror_r (strerror_r (errnum, buf, buflen), buf);
>  #else ...

Ah, great idea. That way I don't even need the #ifdef. Done, will send
a new version now.

Christian

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

* [PATCH v3] Replace the remaining uses of strerror with safe_strerror
  2019-12-09 19:11       ` Christian Biesinger via gdb-patches
@ 2019-12-09 19:13         ` Christian Biesinger via gdb-patches
  2019-12-10 16:41           ` Pedro Alves
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-09 19:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: Christian Biesinger

To do that, this patch makes IPA compile safe-strerror as well. Because
it doesn't use Gnulib, it calls the Glibc version of strerror_r directly.
As I understand it, IPA only needs to work on Linux, so this should be safe.

Consequently this patch also removes the configure checks for strerror.

gdb/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* config.in: Regenerate.
	* configure: Regenerate.
	* gdbsupport/agent.c (gdb_connect_sync_socket): Call
	safe_strerror instead of strerror.
	* gdbsupport/common.m4: Don't check for strerror.
	* gdbsupport/safe-strerror.c: If IN_PROCESS_AGENT is defined,
	call the glibc version of strerror_r.

gdb/gdbserver/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change
	UNDO_GNULIB_CFLAGS to undo strerror_r instead of strerror.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Don't check for strerror.
	* linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer):
	Call safe_strerror instead of strerror.
	* server.h (strerror): Remove this now-unnecessary declaration.
	* tracepoint.c (init_named_socket): Call safe_strerror instead of
	strerror.
	(gdb_agent_helper_thread): Likewise.
	* utils.c (perror_with_name): Likewise.

Change-Id: I74848f072dcde75cb55c435ef9398dc8f958cd73
---
 gdb/config.in                  |  4 ----
 gdb/configure                  | 12 +-----------
 gdb/gdbserver/Makefile.in      |  4 +++-
 gdb/gdbserver/config.in        |  4 ----
 gdb/gdbserver/configure        | 22 +---------------------
 gdb/gdbserver/configure.ac     |  2 +-
 gdb/gdbserver/linux-i386-ipa.c |  4 ++--
 gdb/gdbserver/server.h         |  6 ------
 gdb/gdbserver/tracepoint.c     | 12 ++++++------
 gdb/gdbserver/utils.c          |  2 +-
 gdb/gdbsupport/agent.c         |  4 ++--
 gdb/gdbsupport/common.m4       |  2 +-
 gdb/gdbsupport/safe-strerror.c | 26 +++++++++++++++++++++-----
 13 files changed, 39 insertions(+), 65 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index 1caf76481b..cb886ba8e1 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -117,10 +117,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/configure b/gdb/configure
index 6b64619df7..324eb50944 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13630,17 +13630,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index e79d24f96f..10e004039f 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -304,6 +304,7 @@ GDBREPLAY_OBS = \
 	gdbsupport/errors.o \
 	gdbsupport/netstuff.o \
 	gdbsupport/print-utils.o \
+	gdbsupport/safe-strerror.o \
 	gdbreplay.o \
 	utils.o \
 	version.o
@@ -430,6 +431,7 @@ IPA_OBJS = \
 	gdbsupport/format-ipa.o \
 	gdbsupport/print-utils-ipa.o \
 	gdbsupport/rsp-low-ipa.o \
+	gdbsupport/safe-strerror-ipa.o \
 	gdbsupport/tdesc-ipa.o \
 	regcache-ipa.o \
 	remote-utils-ipa.o \
@@ -557,7 +559,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 # Undo gnulib replacements for the IPA shared library build.
 # The gnulib headers are still needed, but gnulib is not linked
 # into the IPA lib so replacement apis don't work.
-UNDO_GNULIB_CFLAGS = -Drpl_strerror=strerror
+UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
 
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 14cf7099e3..b1e58a3941 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -54,10 +54,6 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRSTR
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index da17f8cb2c..ccffde80ed 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -7022,17 +7022,7 @@ fi
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
@@ -8427,16 +8417,6 @@ _ACEOF
 
 
 
-ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
 ac_fn_c_check_decl "$LINENO" "perror" "ac_cv_have_decl_perror" "$ac_includes_default"
 if test "x$ac_cv_have_decl_perror" = xyes; then :
   ac_have_decl=1
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 07c9bd7fa7..4a6d88ebd1 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -158,7 +158,7 @@ LIBS="$old_LIBS"
 
 libiberty_INIT
 
-AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
+AC_CHECK_DECLS([perror, vasprintf, vsnprintf])
 
 AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
 
diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c
index 2e3d1ac7fe..4bbc1b5f51 100644
--- a/gdb/gdbserver/linux-i386-ipa.c
+++ b/gdb/gdbserver/linux-i386-ipa.c
@@ -210,7 +210,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
   if (!f)
     {    
       snprintf (buf, sizeof (buf), "mmap_min_addr open failed: %s",
-		strerror (errno));
+		safe_strerror (errno));
       set_trampoline_buffer_space (0, 0, buf);
       return;
     }
@@ -233,7 +233,7 @@ initialize_fast_tracepoint_trampoline_buffer (void)
       else
 	{
 	  snprintf (buf, IPA_BUFSIZ, "low-64K-buffer mmap() failed: %s",
-		    strerror (errno));
+		    safe_strerror (errno));
 	  set_trampoline_buffer_space (0, 0, buf);
 	}
     }
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index e01c4f146e..3326159dfe 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -29,12 +29,6 @@ gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
 
 #include "gdbsupport/version.h"
 
-#if !HAVE_DECL_STRERROR
-#ifndef strerror
-extern char *strerror (int);	/* X3.159-1989  4.11.6.2 */
-#endif
-#endif
-
 #if !HAVE_DECL_PERROR
 #ifndef perror
 extern void perror (const char *);
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 2bd75dfb4a..9f8a49174c 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -6879,7 +6879,7 @@ init_named_socket (const char *name)
   result = fd = socket (PF_UNIX, SOCK_STREAM, 0);
   if (result == -1)
     {
-      warning ("socket creation failed: %s", strerror (errno));
+      warning ("socket creation failed: %s", safe_strerror (errno));
       return -1;
     }
 
@@ -6895,7 +6895,7 @@ init_named_socket (const char *name)
       result = unlink (name);
       if (result == -1)
 	{
-	  warning ("unlink failed: %s", strerror (errno));
+	  warning ("unlink failed: %s", safe_strerror (errno));
 	  close (fd);
 	  return -1;
 	}
@@ -6905,7 +6905,7 @@ init_named_socket (const char *name)
   result = bind (fd, (struct sockaddr *) &addr, sizeof (addr));
   if (result == -1)
     {
-      warning ("bind failed: %s", strerror (errno));
+      warning ("bind failed: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -6913,7 +6913,7 @@ init_named_socket (const char *name)
   result = listen (fd, 1);
   if (result == -1)
     {
-      warning ("listen: %s", strerror (errno));
+      warning ("listen: %s", safe_strerror (errno));
       close (fd);
       return -1;
     }
@@ -7219,7 +7219,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (fd < 0)
 	    {
 	      warning ("Accept returned %d, error: %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      break;
 	    }
 
@@ -7231,7 +7231,7 @@ gdb_agent_helper_thread (void *arg)
 	  if (ret == -1)
 	    {
 	      warning ("reading socket (fd=%d) failed with %s",
-		       fd, strerror (errno));
+		       fd, safe_strerror (errno));
 	      close (fd);
 	      break;
 	    }
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 6a0e7a7a0f..b72dd0ec2b 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -47,7 +47,7 @@ perror_with_name (const char *string)
   const char *err;
   char *combined;
 
-  err = strerror (errno);
+  err = safe_strerror (errno);
   if (err == NULL)
     err = "unknown error";
 
diff --git a/gdb/gdbsupport/agent.c b/gdb/gdbsupport/agent.c
index 6d55f586b8..50e9500ffc 100644
--- a/gdb/gdbsupport/agent.c
+++ b/gdb/gdbsupport/agent.c
@@ -149,7 +149,7 @@ gdb_connect_sync_socket (int pid)
   res = fd = gdb_socket_cloexec (PF_UNIX, SOCK_STREAM, 0);
   if (res == -1)
     {
-      warning (_("error opening sync socket: %s"), strerror (errno));
+      warning (_("error opening sync socket: %s"), safe_strerror (errno));
       return -1;
     }
 
@@ -168,7 +168,7 @@ gdb_connect_sync_socket (int pid)
     {
       warning (_("error connecting sync socket (%s): %s. "
 		 "Make sure the directory exists and that it is writable."),
-		 path, strerror (errno));
+		 path, safe_strerror (errno));
       close (fd);
       return -1;
     }
diff --git a/gdb/gdbsupport/common.m4 b/gdb/gdbsupport/common.m4
index 4f2bb5218d..c61753fb8e 100644
--- a/gdb/gdbsupport/common.m4
+++ b/gdb/gdbsupport/common.m4
@@ -35,7 +35,7 @@ AC_DEFUN([GDB_AC_COMMON], [
   AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair sigaction \
 		  sigprocmask])
 
-  AC_CHECK_DECLS([strerror, strstr])
+  AC_CHECK_DECLS([strstr])
 
   # Check for std::thread.  This does not work on some platforms, like
   # mingw and DJGPP.
diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
index c37db579f7..f6fcf5337e 100644
--- a/gdb/gdbsupport/safe-strerror.c
+++ b/gdb/gdbsupport/safe-strerror.c
@@ -20,6 +20,24 @@
 #include "common-defs.h"
 #include <string.h>
 
+/* There are two different versions of strerror_r; one is GNU-specific, the
+   other XSI-compliant.  They differ in the return type.  This overload lets
+   us choose the right behavior for each return type.  We cannot rely on Gnulib
+   to solve this for us because IPA does not use Gnulib but uses this
+   function.  */
+
+/* Called if we have a XSI-compliant strerror_r.  */
+static char *select_strerror_r (int res, char *buf)
+{
+  return res == 0 ? buf : nullptr;
+}
+
+/* Called if we have a GNU strerror_r.  */
+static char *select_strerror_r (char *res, char *)
+{
+  return res;
+}
+
 /* Implementation of safe_strerror as defined in common-utils.h.  */
 
 const char *
@@ -27,11 +45,9 @@ safe_strerror (int errnum)
 {
   static thread_local char buf[1024];
 
-  /* Assign the return value to an int, so we get an error if we accidentally
-     get the wrong version of this function (glibc has two of them...).  */
-  int ret = strerror_r (errnum, buf, sizeof (buf));
-  if (ret == 0)
-    return buf;
+  char *res = select_strerror_r (strerror_r (errnum, buf, sizeof (buf)), buf);
+  if (res != nullptr)
+    return res;
 
   xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
   return buf;
-- 
2.24.0.393.g34dc348eaf-goog

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

* Re: [PATCH v3] Replace the remaining uses of strerror with safe_strerror
  2019-12-09 19:13         ` [PATCH v3] " Christian Biesinger via gdb-patches
@ 2019-12-10 16:41           ` Pedro Alves
  2019-12-10 19:25             ` Christian Biesinger via gdb-patches
  0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2019-12-10 16:41 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches

On 12/9/19 7:13 PM, Christian Biesinger via gdb-patches wrote:

> +/* There are two different versions of strerror_r; one is GNU-specific, the
> +   other XSI-compliant.  They differ in the return type.  This overload lets
> +   us choose the right behavior for each return type.  We cannot rely on Gnulib
> +   to solve this for us because IPA does not use Gnulib but uses this
> +   function.  */
> +
> +/* Called if we have a XSI-compliant strerror_r.  */
> +static char *select_strerror_r (int res, char *buf)

Formatting:

static char *
select_strerror_r (int res, char *buf)


> +{
> +  return res == 0 ? buf : nullptr;
> +}
> +
> +/* Called if we have a GNU strerror_r.  */
> +static char *select_strerror_r (char *res, char *)

Ditto.

> +{
> +  return res;
> +}
> +
OK with those changes.

Thanks,
Pedro Alves

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

* Re: [PATCH v3] Replace the remaining uses of strerror with safe_strerror
  2019-12-10 16:41           ` Pedro Alves
@ 2019-12-10 19:25             ` Christian Biesinger via gdb-patches
  0 siblings, 0 replies; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-10 19:25 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Tue, Dec 10, 2019 at 11:41 AM Pedro Alves <palves@redhat.com> wrote:
>
> On 12/9/19 7:13 PM, Christian Biesinger via gdb-patches wrote:
>
> > +/* There are two different versions of strerror_r; one is GNU-specific, the
> > +   other XSI-compliant.  They differ in the return type.  This overload lets
> > +   us choose the right behavior for each return type.  We cannot rely on Gnulib
> > +   to solve this for us because IPA does not use Gnulib but uses this
> > +   function.  */
> > +
> > +/* Called if we have a XSI-compliant strerror_r.  */
> > +static char *select_strerror_r (int res, char *buf)
>
> Formatting:
>
> static char *
> select_strerror_r (int res, char *buf)
>
>
> > +{
> > +  return res == 0 ? buf : nullptr;
> > +}
> > +
> > +/* Called if we have a GNU strerror_r.  */
> > +static char *select_strerror_r (char *res, char *)
>
> Ditto.
>
> > +{
> > +  return res;
> > +}
> > +
> OK with those changes.

Thanks, made those changes and pushed. Also updated the commit message.

To ssh://sourceware.org/git/binutils-gdb.git
   0e7aaa728d..ab7d13f070  HEAD -> master

Christian

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

end of thread, other threads:[~2019-12-10 19:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 19:59 [PATCH] Replace the remaining uses of strerror with safe_strerror Christian Biesinger via gdb-patches
2019-11-26 21:11 ` [PATCH v2] " Christian Biesinger via gdb-patches
2019-12-06 20:06 ` [PATCH] " Pedro Alves
2019-12-06 20:36   ` Christian Biesinger via gdb-patches
2019-12-06 20:44     ` [PATCH v3] " Christian Biesinger via gdb-patches
2019-12-06 21:46     ` [PATCH] " Pedro Alves
2019-12-09 19:11       ` Christian Biesinger via gdb-patches
2019-12-09 19:13         ` [PATCH v3] " Christian Biesinger via gdb-patches
2019-12-10 16:41           ` Pedro Alves
2019-12-10 19:25             ` Christian Biesinger via gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).