Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: SZOKOVACS Robert <szo@ies.hu>
Cc: gdb-patches@sources.redhat.com
Subject: Re: meaningful error message in gdbserver
Date: Sat, 17 Sep 2005 23:12:00 -0000	[thread overview]
Message-ID: <20050917231201.GN8777@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0508311929060.17751-100000@server.ies-hungary.intra>

On Wed, Aug 31, 2005 at 07:30:05PM +0200, SZOKOVACS Robert wrote:
> Hi,
> 
> I had a long day fighting with remote debugging, until I found out that my
> libpthread and libthread_db versions didn't match. So I created the patch
> below that makes gdbserver more verbose when failing, maybe it can save
> some time for somebody in the future.

Thanks for the suggestion.  I've checked in this instead - a bit more
thorough.

[As an aside, I don't know how I've managed to fix this bit of
aclocal.m4 so many times without realizing I'd scrogged the braces.]

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>

	* acinclude.m4: Correct quoting.
	* aclocal.m4: Regenerated.

	Suggested by SZOKOVACS Robert <szo@ies.hu>:
	* thread-db.c (thread_db_err_str): Handle TD_VERSION.
	(thread_db_init): Call thread_db_err_str.
	* configure.ac: Check for TD_VERSION.
	* config.in, configure: Regenerated.

Index: acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/acinclude.m4,v
retrieving revision 1.3
diff -u -p -r1.3 acinclude.m4
--- acinclude.m4	24 Feb 2005 20:26:32 -0000	1.3
+++ acinclude.m4	17 Sep 2005 23:08:56 -0000
@@ -38,6 +38,6 @@ AC_DEFUN([SRV_CHECK_THREAD_DB],
   [td_ta_new();],
   [srv_cv_thread_db="$thread_db"],
   [srv_cv_thread_db=no])
-  ]])
+  ])
  LIBS="$old_LIBS"
-)])
+])])
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.6
diff -u -p -r1.6 configure.ac
--- configure.ac	13 Jul 2005 15:21:02 -0000	1.6
+++ configure.ac	17 Sep 2005 23:08:57 -0000
@@ -142,6 +142,13 @@ fi
 if test "$srv_linux_thread_db" = "yes"; then
   srv_thread_depfiles="thread-db.o proc-service.o"
   USE_THREAD_DB="-DUSE_THREAD_DB"
+  AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version,
+  [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;],
+                  [gdbsrv_cv_have_td_version=yes],
+                  [gdbsrv_cv_have_td_version=no])])
+  if test $gdbsrv_cv_have_td_version = yes; then
+    AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.])
+  fi
 fi
 
 GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
Index: thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/thread-db.c,v
retrieving revision 1.2
diff -u -p -r1.2 thread-db.c
--- thread-db.c	16 Oct 2004 17:42:00 -0000	1.2
+++ thread-db.c	17 Sep 2005 23:08:57 -0000
@@ -103,6 +103,10 @@ thread_db_err_str (td_err_e err)
       return "only part of register set was written/read";
     case TD_NOXREGS:
       return "X register set not available for this thread";
+#ifdef HAVE_TD_VERSION
+    case TD_VERSION:
+      return "version mismatch between libthread_db and libpthread";
+#endif
     default:
       snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err);
       return buf;
@@ -361,7 +365,8 @@ thread_db_init ()
       return 1;
 
     default:
-      warning ("error initializing thread_db library.");
+      warning ("error initializing thread_db library: %s",
+	       thread_db_err_str (err));
     }
 
   return 0;


      reply	other threads:[~2005-09-17 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31 19:04 SZOKOVACS Robert
2005-09-17 23:12 ` Daniel Jacobowitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050917231201.GN8777@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=szo@ies.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox