lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Understading LWIP_DEBUG()


From: address@hidden
Subject: Re: [lwip-devel] Understading LWIP_DEBUG()
Date: Fri, 21 Oct 2011 19:38:54 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

Gisle Vanem wrote:
What should I set $LWIP_DEBUG to to get some output? Tried
'0x80', but nothing...
Looking at the definition of LWIP_DEBUGF, it depends on tree things: LWIP_DBG_ON, LWIP_DBG_TYPES_ON and LWIP_DBG_MIN_LEVEL. So every debug level 'debug' passed to LWIP_DEBUGF has to:
- have the flag 'LWIP_DBG_ON' set (0x80)
- have any of the flags in 'LWIP_DBG_TYPES_ON' set: LWIP_DBG_TRACE (0x40), LWIP_DBG_STATE (0x20), LWIP_DBG_FRESH (0x10) or LWIP_DBG_HALT (0x08) - depending on what LWIP_DBG_TYPES_ON is defined to
- have a level >= LWIP_DBG_MIN_LEVEL

So for a message for PING_DEBUG to be printed, this should be enough (LWIP_DBG_LEVEL_ALL defaults to 0 anyway):
#define PING_DEBUG    LWIP_DBG_ON
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT).

Now the LWIP_DBG_TYPES_ON is somewhat hard to understand, as most messages throughout the code don't use a type (i.e. only LWIP_DBG_ON). Therefore, to see these messages, you need the LWIP_DBG_ON bit in the definition of LWIP_DBG_TYPES_ON. However, you *can* define it to (LWIP_DBG_FRESH|LWIP_DBG_HALT) to only see messages from FRESH code or HALT conditions.

Hope that helps.

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]