On Aug 4, 2006, at 1:44 PM, John Baldwin wrote:

Places that call kdb_enter() aren't all #ifdef KDB IIRC.  It's
just a feature that kdb_foo() functions become NOPs when the kernel isn't configured for debugging, so I think the #ifdef KDB's would be redundant.

None of the kdb_*() functions in src/sys/kern/subr_kdb.c turn into
NOPs when option KDB is not present. They are all unconditionally
functional by design and should therefore be called conditionally
by consequence.

Well, given that separation, I'm not sure KDB is the right option to make calls conditional. Rather, some specific is-debugging-enabled? option (like
INARIANTS or FOO_DEBUG) should be used instead.  i.e.:

#ifdef FOO_DEBUG
        if (foo_bad) {
                printf("foo is bad\n");
                kdb_backtrace();
        }
#endif

I don't think that warrants an extra #ifdef KDB.

Exactly. Here, FOO_DEBUG serves roughly the same function as KDB.
Where KDB's scope is limitless, FOO_DEBUG typically applies to
foo(4) only.

--
 Marcel Moolenaar         USPA: A-39004          [EMAIL PROTECTED]


_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to