[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Understading LWIP_DEBUG()
From: |
Gisle Vanem |
Subject: |
[lwip-devel] Understading LWIP_DEBUG() |
Date: |
Fri, 21 Oct 2011 01:50:06 +0200 |
I'm utterly bewildered by all the macros in lwIP. E.g. the
LWIP_DEBUGF() macro is defined as:
#define LWIP_DEBUGF(debug, message) do { \
if ( \
((debug) & LWIP_DBG_ON) && \
((debug) & LWIP_DBG_TYPES_ON) && \
((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >=
LWIP_DBG_MIN_LEVEL) ) { \
LWIP_PLATFORM_DIAG(message); \
...
And used as e.g:
LWIP_DEBUGF( PING_DEBUG, ("ping: send "));
I got an idea from contrib/ports/unix/proj/minimal/main.c (debug_flags),
but failed to see how I can mask PING_DEBUG==1 in my lwipopts.h to get
the message printed.
In my lwipopts.h I have:
extern unsigned int debug_flags;
#define LWIP_DBG_TYPES_ON debug_flags
an in src/contrib/ports/win32/test.c (main.c) I have:
const char *e = getenv("LWIP_DEBUG");
if (e)
sscanf(e,"0x%x", &debug_flags);
What should I set $LWIP_DEBUG to to get some output? Tried
'0x80', but nothing...
--gv
- [lwip-devel] Understading LWIP_DEBUG(),
Gisle Vanem <=