[KinoSearch] DEBUG() and ASSERT()

Marvin Humphrey marvin at rectangular.com
Mon Oct 15 16:48:17 PDT 2007




On Sep 30, 2007, at 1:39 PM, Nathan Kurz wrote:

> On 9/28/07, Marvin Humphrey <marvin at rectangular.com> wrote:
>> No worries, mate.  Can you show me how you normally like your
>> DEBUG and ASSERT macros set up?

OK, I've finished integrating/implementing this.  The guts are  
somewhat different, but for the most part the API is the same and you  
are going to be able to use it as you are accustomed to.  Here are  
some the changes that were made which are visible from the outside:

   * Output to stderr rather than stdout.
   * Enabled via KINO_DEBUG environment variable rather than DEBUG.
   * All the macros take their familiar names when short names are in
     effect; at other times, they need the KINO_ prefix.
   * You don't have to be worry about weird combinations of commas
     and whitespace causing strange behavior.

> It's a little tricky to integrate this system with the XS loader and
> builder.  I've done it before by creating a Makefile that creates both
> a normal and debug version and changes the XS bootstrap function to
> use libfoo.so or libfoo_debug.so according to the DEBUG environment
> variable.  For now it may be simpler to just build one at a time,
> switching by hand.

It'd be pretty killer to get this happening.  My initial thought is  
that it would be better to load the debug version of the shared  
library via a "use" directive than an environment variable, since % 
ENV is tainted.

   use KinoSearch 'DEBUG';

I don't suppose we could get full C stack traces happenin', could we?

   http://www.gnu.org/software/libc/manual/html_node/Backtraces.html

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/



_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch




More information about the kinosearch mailing list