[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-members] new debugging features in CVS
From: |
Jani Monoses |
Subject: |
Re: [lwip-members] new debugging features in CVS |
Date: |
Fri, 21 Feb 2003 16:18:19 +0200 |
After some more thought and trial here's what I propose:
1)Have everything configurable set to defaults in lwip/opt.h
only put defines which appear in lwip core not DEBUG_TAPIF,DEBUG_DEMO etc.
2)debug.h should contain the flags and diagnostic definitions but NO
user-overridable settings (diags are overwritten by platform that's OK)
3)A project should compile with empty lwipopts.h
lwip/opt.h looks like
#include "lwip/debug.h" //this provides the dbg flags to lwipopts
#include "lwipopts.h" // anything the user wants to redefine
//every default here:
#ifndef LWIP_FOO
#define LWIP_FOO DEFOOLT
#endif
...
Right now I see no drawback to this scheme (otherwise I wouldn't have posted ;)
but the benefits are smaller & easier to manage lwipopts and lwip files can
now include opt.h and not debug since that is included anyway.
what do you think?
> Hello Jani,
> > But does this mean lwipopts.h must define every modules' debug flag?
> > Can't the behaviour of old debug.h includes lwipopts.h be preserved
> > where debug.h defines every previously undefined (in lwipopts) macro.
> >
> Yes, that would be perfect.
>
> The problem is that lwipopts.h now depends on debug.h (for the debug flags)
> and not vice versa.
>
> Fixing this would mean debug.h including lwipopts.h only after the debug
> types
> have been defined.
>
> Of course, any other nicer approach would be more welcome.
>
> As a sidenote, before the new finer grained debug scheme starts to pay,
> additional debug type flag and level must be given to DEBUGF statements.
> For example DEBUGF(UDP_DEBUG | DBG_TRACE | 2, "some flow following debug
> statement of 2");
>
> Leon.
>
>
>
> _______________________________________________
> lwip-members mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-members
Re: [lwip-members] new debugging features in CVS, Jani Monoses, 2003/02/20