[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [linux-lvm] Re: [lvm-devel] 1.2 direc

Regarding debugging output, I just recently spent some time playing
with GNU Nana, a library for assertion checking and logging in GNU
C/C++.  It has some very interesting and useful features:

   GNU Nana is a free library providing improved support for assertion
   checking (as in assert.h) and logging (printf style debugging) in GNU
   C and C++. It provides support for some of the ideas of Eiffel, VDM, Z
   and Anna in GNU C/C++. GNU Nana was developed by Phil Maker.
   For full documentation, see [1]the Nana manual. or the online manual
   available at [2]www.gnu.org/manual/nana/index.html.
     * Space/time efficient, at least compared to assert.h. For example
       assert(i >= 0) uses 53 bytes on the x86, while Nana uses either 10
       bytes or 1.
     * Support for predicate calculus (``for all,'' ``exists,'' and so
       on) is provided using both C style for loops and C++ STL iterators
       over container classes.
     * Assertions can refer to saved state; for exaple, the return value
       of a sort function can be checked against the arguments on
       function entry.
     * Logging messages can be redirected to a variety of destinations
       including files, processes (for automated testing or
       visualisation) or circular buffers in core.
     * Assertions about time can be made in a simple manner.
     * Lists of invariant checking or printing functions can be created
       which can then be called to check internal consistency or display
     * All of the features can be selectively enabled or disabled at both
       compile and run time.

Not mentioned in this list is that the logging and assertion calls can
be made either in native C or entirely in gdb commands.  It's very
slick, and I plan on incorporating it in any C or C++ coding projects
I work on.

Anyway, this may afford you some more flexibility in how you use
debugging messages, assertion checking, etc.  Hope this info is

Chad Walstrom <chewie wookimus net>                 | a.k.a. ^chewie
http://www.wookimus.net/                            | s.k.a. gunnarr
Key fingerprint = B4AB D627 9CBD 687E 7A31  1950 0CC7 0B18 206C 5AFD

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]