From gbenson@redhat.com Wed Apr 20 14:49:00 2016 From: gbenson@redhat.com (Gary Benson) Date: Wed, 20 Apr 2016 14:49:00 -0000 Subject: Infinity client library first look Message-ID: <20160420144929.GA17505@blade.nx> Hi all, This past few weeks I've been working on an Infinity client library for programs to use to access and execute Infinity notes. It's very alpha at the moment, but if you'd like to build and execute an Infinity note there's instructions at . There's very little documentation as yet (and certainly no API/ABI guarantees!) but you can see the shape of the library and the kind of API to expect. The "tlsdump_process" function in examples/tlsdump.c and the "process_notes" function it calls is the core of it all: 1. Use i8x_ctx_new to create a context. 2. Use i8x_note_new_from_buf, i8x_func_new_from_note and i8x_ctx_register_func to load, compile and register note functions into the context. (3. Use i8x_inferior_new to create a representation of the inferior process you're accessing. This isn't present yet, it's the NULL in the arguments of i8x_xctx_call below.) 4. Use i8x_xctx_new to create an execution context. 5. Use i8x_ctx_get_funcref to get references to the functions you're going to call. 6. Use i8x_xctx_call to execute the note functions. The point of the context/inferior/execution context separation is to allow for systems where one executable+solibs spawns multiple inferior processes, and for multithreaded clients. * one executable+solibs maps to one i8x_ctx * one inferior process maps to one i8x_inferior * one thread in your client maps to one i8x_xctx. Full multithreaded support may not exist straight away (GDB doesn't need it) but I didn't want to lay out an API/ABI that could never support it. I've never written a library before, so please hit me with your questions and concerns! Cheers, Gary -- http://gbenson.net/ From gbenson@redhat.com Fri Apr 22 10:44:00 2016 From: gbenson@redhat.com (Gary Benson) Date: Fri, 22 Apr 2016 10:44:00 -0000 Subject: I8C 0.0.2 released Message-ID: <20160422104421.GA27455@blade.nx> I8C 0.0.2 released! Release 0.0.2 of I8C, the Infinity Note Compiler, is now available. This includes I8X, an interpreter for unit testing compiled notes. You can install I8C and I8X directly using pip: pip install -U --user i8c # installs in your home directory sudo pip install -U i8c # installs as root The source is available on PyPI: https://pypi.python.org/packages/source/i/i8c/i8c-0.0.2.tar.gz (md5sum 7c596e3989ea8b0030af7e99c27b2016) There is a web page for I8C at: https://sourceware.org/gdb/wiki/Infinity/ That page includes information about the Infinity mailing list, details on how to access I8C's source repository, and information about the Infinity system in general. I8C 0.0.2 brings new features and improvements, including: * Operators with more than one argument now require their arguments to be separated by commas. Existing code using the "name" and "cast" operators must be updated. * Externals are no longer pushed onto the stack at function entry. Existing code can be made to work by adding load statements at the start of the function, though it's usually possible to eliminate some stack manipulation code by rewriting functions with loads where they're needed. * Many operators now have an optional "folded load" first argument. A folded load is exactly equivalent to a load immediately before * The "deref" operator now accepts "offset(base)" syntax for its optional folded load argument. * The "name" operator now accepts slot names as its first argument. This can be used to add new names to already-named slots by name. * "extern" statements are now allowed outside of function definitions, where they will be inherited by all functions in the same file. * Older versions of unittest are detected and handled in setup.py; both the testsuite and I8X should now work out of the box with Python 2.6 and 3.1. * There is the start of an Emacs major mode in "contrib/i8-mode.el". * I8X now has a system which testcases may use to lay out test address spaces to check memory accesses using "deref" et al. For a complete list and more details on each item, please see the NEWS.rst file. -- Gary Benson From gbenson@redhat.com Fri Jun 10 11:16:00 2016 From: gbenson@redhat.com (Gary Benson) Date: Fri, 10 Jun 2016 11:16:00 -0000 Subject: I8C 0.0.3 released Message-ID: <20160610111635.GA14188@blade.nx> I8C 0.0.3 released! Release 0.0.3 of I8C, the Infinity Note Compiler, is now available. This includes I8X, an interpreter for unit testing compiled notes. You can install I8C and I8X directly using pip: pip install -U --user i8c # installs in your home directory sudo pip install -U i8c # installs as root The source is available from infinitynotes.org: https://infinitynotes.org/src/i8c/i8c-0.0.3.tar.gz (md5sum 3f61028a016045749479c64ec4b019a1) There is a web page for I8C at: https://infinitynotes.org/wiki/I8C That page includes information about the Infinity mailing list, details on how to access I8C's source repository, and information about the Infinity system in general. I8C 0.0.3 brings new features and improvements, including: * I8C now supports the use of the environment variables "I8C_CC", "I8C_CPP" and "I8C_AS" to specify the external compiler it will use. * When invoked with "-S -fpreprocessed", I8C now prepends its output with an "#include" statement for each "-include" option specified on the command line. * "extern ptr" statements are now output as DW_OP_addr instructions. * Two new wide operations I8_OP_cast_int2ptr and I8_OP_cast_ptr2int have been added to support "cast" statements, and the "cast" operator now rejects operations which are invalid or unnecessary. * The signed types for the deref operator have been renamed from s8, s16, s32 and s64 to i8, i16, i32 and i64. * The byte order mark from the code info chunk has been replaced with an architecture specifier which encodes both byte order and wordsize, and a new directive "wordsize" has been added to specify the word size of the target system in environments where I8C cannot determine it automatically. For a complete list and more details on each item, please see the NEWS.rst file. -- https://infinitynotes.org/ From gbenson@redhat.com Mon Jun 13 09:32:00 2016 From: gbenson@redhat.com (Gary Benson) Date: Mon, 13 Jun 2016 09:32:00 -0000 Subject: First Infinity full-system preview now available Message-ID: <20160613093200.GA29173@blade.nx> Over the past few weeks I've been working on a full-system preview release of Infinity. It's now available: https://infinitynotes.org/wiki/First_Flight This release comprises just enough of Infinity for GDB to attach to a live process or start with a core file. "info threads" should work, "print errno" does not. The page linked above details how to: * Build glibc with Infinity notes for thread debugging * Run applications using that glibc. * Use unmodified GDB to debug those applications using Infinity. All this can be done as a normal user (root access is not required). This release should allow you to see what Infinity notes look like in the field. The notes in this release add 880 bytes to libpthread.so on x86_64. This is probably about half of what GDB needs to replicate what it needs from libthread_db, so I expect 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. This preview uses a libthread_db shim that calls into the Infinity client library libi8x. This shim exists for the purposes of this preview release only: there are NO current plans to make this shim suitable for production use: clients that wish to access libpthread internals via a libthread_db-style interface can continue to use the libthread_db.so provided by glibc. Please direct questions to infinity@sourceware.org. Thanks! Gary -- https://infinitynotes.org/