This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[RFC v2][PATCH 00/27] Infinity full-system preview


Hi all,

I'm 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 grew from a need for
GDB to be able to debug multithreaded inferiors without requiring
libthread_db, but it's suitable for other systems that need to expose
internals to debuggers such as the run-time linker (e.g. for dlmopen
support) 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.

This series is version 2 of a series I posted back in October:

  https://sourceware.org/ml/libc-alpha/2015-10/msg00690.html

The main difference is that the October series was build-only: there
was no way to execute the notes it built into libpthread.so.  This
series comes with the ability to try thread-debugging with the notes
using unmodified GDB.  Instructions here:

  https://infinitynotes.org/wiki/First_Flight

Most of the patches in this series are there to support the last few,
and are fairly uninteresting.  If you'd like to look in detail at this
series I'd suggest starting at patch 20:

 [PATCH 20/27] Add ./configure checks for I8C and I8X

   This patch adds configure checks for I8C (the Infinity note
   compiler) and I8X (the Infinity note testing framework).  This
   patch differs from the previous version as follows:

     * There is now a --with-infinity option.  If specified, configure
       will fail if I8C and I8X are not present or too old.  If
       --without-infinity is specified then no checks will be
       performed.  If neither is specified then --with-infinity will
       be assumed if I8C is found on the build system.

     * Minimum versions of I8C and I8X are listed in
       manual/install.texi and INSTALL.

 [PATCH 21/27] Add Makerules to build %.o and %.os from %.i8

   This patch adds make rules to build %.o and %.os files from %.i8
   Infinity note source code.  This patch differs from the previous
   version as follows:

     * Some no-longer-necessary rules have been removed.

     * "-include sysdep.h" is passed to I8C to ensure the correct
       assembler directives for ARM are included.

 [PATCH 22/27] Export stack_used as __stack_used

   This patch was not in the previous series.  It exports stack_used
   internally as __stack_used in the same way __stack_user is exported
   to makes it visible to the libpthread::thr_iter note function.

 [PATCH 24/27] Add Infinity notes implementing libpthread::map_lwp2thr
 [PATCH 25/27] Add Infinity notes implementing libpthread::thr_iter
 [PATCH 26/27] Add Infinity notes implementing libpthread::thr_get_lwpid
 [PATCH 27/27] Add Infinity notes implementing libpthread::thr_get_state

   These patches add the source code for 4 Infinity functions.  They
   also add test cases for those functions.

This series isn't complete.  With it GDB can attach to processes (and
load core files) and do "info threads", but two more libthread_db
functions need implementing as notes before GDB will be able to do
everything without libthread_db.  These are the two TLS accessors
td_thr_tlsbase and td_thr_tls_get_addr.

The current set of notes adds 880 bytes to libpthread.so on x86_64.
I anticipate the TLS functions adding as much again, so I'm expecting
the final overhead to be about 1.7k, some of which will be in the
runtime linker.  Please note that Infinity notes are NOT mapped into
memory.

I'm expecting the final version of this series to look pretty much as
this version does, but with ChangeLogs and with two extra patches for
the TLS accessors.

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

Thanks,
Gary

--
http://gbenson.net/


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