Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Only try to load libthread_db when we load libpthread.
@ 2011-10-05 18:27 Doug Evans
  2011-10-06 11:22 ` Pedro Alves
  0 siblings, 1 reply; 11+ messages in thread
From: Doug Evans @ 2011-10-05 18:27 UTC (permalink / raw)
  To: gdb-patches

Hi.

System libraries are typically last in the list of libraries to load,
and in a program with lots of shared libraries this results
in lots of pointless attempts to load libthread_db.

No regressions in amd64-linux,
but I can imagine it misses some cases.

2011-10-05  Doug Evans  <dje@google.com>

	* linux-thread-db.c (thread_db_new_objfile): Only try to load
	libthread_db when we load libpthread.

Index: linux-thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
retrieving revision 1.91
diff -u -p -r1.91 linux-thread-db.c
--- linux-thread-db.c	13 Sep 2011 19:27:01 -0000	1.91
+++ linux-thread-db.c	5 Oct 2011 18:16:17 -0000
@@ -1083,7 +1083,12 @@ thread_db_new_objfile (struct objfile *o
   /* This observer must always be called with inferior_ptid set
      correctly.  */
 
-  if (objfile != NULL)
+  if (objfile != NULL
+      /* Only check for thread_db if we loaded libpthread.
+	 Libpthread can be near the end of the list of shared libraries to
+	 load, and in an app of several thousand shared libraries, this can
+	 otherwise be painful.  */
+      && libpthread_name_p (objfile->name))
     check_for_thread_db ();
 }
 


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

end of thread, other threads:[~2011-10-11  3:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 18:27 [RFA] Only try to load libthread_db when we load libpthread Doug Evans
2011-10-06 11:22 ` Pedro Alves
2011-10-06 19:56   ` Pedro Alves
2011-10-06 20:08     ` Doug Evans
2011-10-06 20:26       ` Pedro Alves
2011-10-06 21:56         ` Doug Evans
2011-10-06 22:06           ` Doug Evans
2011-10-07 11:09             ` Pedro Alves
2011-10-10  5:01               ` Doug Evans
2011-10-10 18:23                 ` Pedro Alves
2011-10-11  3:38                   ` Doug Evans

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