This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] Partial fix for debugging static threaded apps


On Wed, Dec 08, 2004 at 11:50:54AM -0500, Daniel Jacobowitz wrote:
> This patch finally connects linux-thread-db.c to the new inferior_created
> observer.  The thread_db_new_objfile hook is broken out into a common
> function; it is called when new shared libraries are loaded, and when
> a new inferior is created or attached to.  It's fairly straightforward.
> 
> What isn't straightforward are the other issues with staticthreads.exp.
> Both of these were observed on my desktop system, a Debian GNU/Linux
> unstable, i686-linux system running NPTL and a 2.6 kernel.
> 
> (A) This patch isn't strictly necessary, because there is always a shared
> library - even for static applications.  That's because my kernel supports
> the vsyscall DSO, and GDB now handles it.  The patch is still necessary for
> non-vsyscall setups.
> 
> (B) This patch isn't sufficient, because GDB is dynamically linked to
> libthread_db, and loads it from /lib/tls/i686/cmov/libthread_db.so.1. That's
> NPTL.  staticthreads is statically linked and gets LinuxThreads instead
> of NPTL.  I have a follow-up patch which allows GDB to load both copies of
> libthread_db and use the right one.  That fixes staticthreads.exp for me.
> I'll clean it up for submission after this patch is settled.
> 
> Is this patch OK?

Ping.  Michael, sorry about this; you asked me months ago if this patch
was still current and I never got back to you.  As far as I know, yes,
it's still current.

> 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
> 
> 	* Makefile.in (linux-thread-db.o): Add $(observer_h).
> 	* linux-thread-db.c: Include "observer.h".
> 	(check_for_thread_db): New function, broken out from
> 	thread_db_new_objfile.  Update comments.  Delete redundant
> 	using_thread_db check.
> 	(thread_db_new_objfile): Call check_for_thread_db.
> 	(check_for_thread_db_observer): New function.
> 	(_initialize_thread_db): Register an inferior_created
> 	observer.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]