This is the mail archive of the gdb-patches@sourceware.org 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]

Infinity full-system preview


Hi all,

I've been working on a platform-independent system for executables and
shared libraries to expose functionality to debug, monitoring, and
analysis tooling.  It's called Infinity.  It's basically so that GDB
can debug multithreaded inferiors without requiring libthread_db, but
it's suitable for other systems such as the run-time linker (e.g. so
we can support dlmopen) and OpenMP.

Rather than requiring a plugin library that the debugger loads, in
Infinity debug functions are shipped as DWARF bytecode in ELF notes
in the actual library they are for, so, e.g., the notes implementing
what libthread_db.so currently implements live in libpthread.so.
The idea is that GDB keeps a track of the notes it finds in objfiles
it's loaded, and when complete sets arrive it enables that particular
subsystem.  So, when the five notes GDB needs to support multithreaded
inferiors appear then thread debugging switches on.  This works
regardless of whether the notes came from a library (libpthread.so)
or from the main executable (-static -pthread).

So far I've written:

 * Enough notes for GDB to attach to a process (or load a core
   file) and do "info threads"
 * A client library that can execute those notes.

I've not written the GDB part of this yet, but I've put together a
shim libthread_db.so that loads notes from the inferior and uses the
client library to execute them.  The code in the libthread_db shim is
something like what will end up in GDB and gdbserver, with a load of
extra supporting code that GDB doesn't need, e.g. ELF parsing.

If you'd like to try this out there's instructions here:

  https://infinitynotes.org/wiki/First_Flight

You can use any recent GDB unmodified for this.  You don't need root.

I mailed an RFC series of the glibc side to libc-alpha for comment.
The series starts here:

  https://sourceware.org/ml/libc-alpha/2016-06/msg00476.html

Infinity's mailing list is infinity@sourceware.org, so please
subscribe if you're interested (by sending an empty message to
infinity-subsribe@).

Cheers,
Gary

-- 
http://gbenson.net/


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